# 27sayan/sql_injection-learning_and_testing architecture

> Architecture diagram of the GitHub repository 27sayan/sql_injection-learning_and_testing, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/27sayan/sql_injection-learning_and_testing
- Repository: https://github.com/27sayan/sql_injection-learning_and_testing

## Overview

SQL-Injection is a website for learning and practicing SQL injection. The intended user journey is through its learning and testing pages; the README describes local XAMPP setup with a MySQL database. The sampled PHP files show separate registration/login handling and several credential-query variants, including vulnerable-style and parameterized or transformed queries. The HTML pages and their form wiring were not sampled, so links from pages to particular handlers are omitted; the documented capabilities are represented without assuming their runtime routing.

Main entry points: [`scripts/buttons.js`](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/scripts/buttons.js) (Page navigation), [`README.md`](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/README.md) (Learning site), [`learning.html`](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/learning.html) (Learning page), [`testing.html`](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/testing.html) (Testing page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Learning website"]
  node_site["Learning site<br/>[README.md]"]
  node_home["Home page<br/>[index.html]"]
  node_learning["Learning page<br/>[learning.html]"]
  node_testing["Testing page<br/>[testing.html]"]
  node_database_view["Database guide<br/>[database.html]"]
  node_docs_view["Documentation<br/>[docs.html]"]
  node_buttons["Page navigation<br/>[buttons.js]"]
end

subgraph group_auth["Accounts"]
  node_login_page["Login page<br/>[login.html]"]
  node_form_ui["Login interactions<br/>[login.js]"]
  node_signup["Registration<br/>[signup.php]"]
  node_main_login["Customer login<br/>[mainlogin.php]"]
end

subgraph group_labs["Query practice"]
  node_legacy_login["Basic credential check<br/>[login.php]"]
  node_escape_login["Escaped input check<br/>[escape.php]"]
  node_parameter_login["Parameterized check<br/>[parameter.php]"]
  node_input_hash_login["Input and password hash<br/>[logininputhash.php]"]
  node_password_hash_login["Password hash check<br/>[loginpasshash.php]"]
end

node_visitor(("Learner"))
node_mysql[("MySQL project DB")]
node_schema["Login table schema<br/>[login_details.sql]"]

node_visitor -->|"uses"| node_site
node_site -->|"teaches"| node_learning
node_site -->|"offers practice"| node_testing
node_buttons -->|"navigates to"| node_testing
node_buttons -->|"navigates to"| node_learning
node_buttons -->|"navigates to"| node_login_page
node_form_ui -.->|"validates forms"| node_login_page
node_signup -->|"writes customer"| node_mysql
node_main_login -->|"queries customer"| node_mysql
node_legacy_login -->|"queries users"| node_mysql
node_escape_login -->|"queries users"| node_mysql
node_parameter_login -->|"queries users"| node_mysql
node_input_hash_login -->|"queries users"| node_mysql
node_password_hash_login -->|"queries users"| node_mysql
node_schema -.->|"defines schema"| node_mysql

click node_site "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/README.md"
click node_home "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/index.html"
click node_learning "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/learning.html"
click node_testing "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/testing.html"
click node_database_view "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/view/database.html"
click node_docs_view "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/view/docs.html"
click node_login_page "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/login.html"
click node_form_ui "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/scripts/login.js"
click node_signup "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/backend/signup.php"
click node_main_login "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/backend/mainlogin.php"
click node_legacy_login "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/backend/login.php"
click node_escape_login "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/backend/escape.php"
click node_parameter_login "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/backend/parameter.php"
click node_input_hash_login "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/backend/logininputhash.php"
click node_password_hash_login "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/backend/loginpasshash.php"
click node_schema "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/db/login_details.sql"
click node_buttons "https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/scripts/buttons.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_site,node_home,node_learning,node_testing,node_database_view,node_docs_view,node_buttons toneBlue
class node_login_page,node_form_ui,node_signup,node_main_login,node_mysql toneAmber
class node_legacy_login,node_escape_login,node_parameter_login,node_input_hash_login,node_password_hash_login toneMint
class node_visitor toneIndigo
class node_schema toneTeal
```

## Components

### Learning website

- [Learning site](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/README.md): `README.md`
- [Home page](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/index.html): `index.html`
- [Learning page](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/learning.html): `learning.html`
- [Testing page](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/testing.html): `testing.html`
- [Database guide](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/view/database.html): `view/database.html`
- [Documentation](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/view/docs.html): `view/docs.html`
- [Page navigation](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/scripts/buttons.js): `scripts/buttons.js`

### Accounts

- [Login page](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/login.html): `login.html`
- [Login interactions](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/scripts/login.js): `scripts/login.js`
- [Registration](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/backend/signup.php): `backend/signup.php`
- [Customer login](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/backend/mainlogin.php): `backend/mainlogin.php`

### Query practice

- [Basic credential check](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/backend/login.php): `backend/login.php`
- [Escaped input check](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/backend/escape.php): `backend/escape.php`
- [Parameterized check](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/backend/parameter.php): `backend/parameter.php`
- [Input and password hash](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/backend/logininputhash.php): `backend/logininputhash.php`
- [Password hash check](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/backend/loginpasshash.php): `backend/loginpasshash.php`

### Other components

- **Learner**
- **MySQL project DB**
- [Login table schema](https://github.com/27sayan/sql_injection-learning_and_testing/blob/main/db/login_details.sql): `db/login_details.sql`

## Connections

- Learner → Learning site: uses (evidence: `README.md`)
- Learning site → Learning page: teaches (evidence: `README.md`)
- Learning site → Testing page: offers practice (evidence: `README.md`)
- Page navigation → Testing page: navigates to (evidence: `scripts/buttons.js`)
- Page navigation → Learning page: navigates to (evidence: `scripts/buttons.js`)
- Page navigation → Login page: navigates to (evidence: `scripts/buttons.js`)
- Login interactions → Login page: validates forms
- Registration → MySQL project DB: writes customer (evidence: `backend/signup.php`)
- Customer login → MySQL project DB: queries customer (evidence: `backend/mainlogin.php`)
- Basic credential check → MySQL project DB: queries users (evidence: `backend/login.php`)
- Escaped input check → MySQL project DB: queries users (evidence: `backend/escape.php`)
- Parameterized check → MySQL project DB: queries users (evidence: `backend/parameter.php`)
- Input and password hash → MySQL project DB: queries users (evidence: `backend/logininputhash.php`)
- Password hash check → MySQL project DB: queries users (evidence: `backend/loginpasshash.php`)
- Login table schema → MySQL project DB: defines schema
