PHO Login And Registration SystemPHO Login And Registration System
Secure PHP login and registration system with email verification, password reset, CSRF protection, and a clean Bootstrap 5 interfaPHO Login And Registration System
Secure PHP login and registration system with email verification, password reset, CSRF protection...
Overview
PHP Login & Registration System is a secure and modern authentication module built with PHP, MySQL, PHPMailer, and Bootstrap 5. It comes with user registration, login, email verification, password reset via email, and a protected user dashboard.
You can easily integrate this system into any existing PHP project or use it as a standalone authentication module.
Features
User Registration with validation
- Login with email and password
- Secure password hashing (password_hash, password_verify)
- Email verification (activation link sent to user’s email)
- Forgot password & password reset via email link
- Session-based authentication (protected pages)
- Logout functionality
- CSRF token protection on important forms
- SQL Injection protection using prepared statements (MySQLi or PDO)
- XSS protection with htmlspecialchars()
- Clean and modern Bootstrap 5 design
- Responsive layout for mobile, tablet, and desktop
- Well-structured and commented code
Requirements
PHP 7.4+ / 8.x
- MySQL / MariaDB
- PHPMailer (SMTP)
- HTML5, CSS3, Bootstrap 5
- JavaScript (basic validation)
Instructions
# PHP Login & Registration System
A secure and modern PHP Login & Registration System with email verification, password reset, and user dashboard. Built with PHP, MySQL, PHPMailer, and Bootstrap 5.
---
## 🔐 Features
- User Registration & Login
- Secure password hashing (`password_hash`, `password_verify`)
- Email verification (activation link)
- Forgot password & password reset via email
- Session-based authentication
- Logout functionality
- CSRF protection for important forms
- SQL Injection protection (prepared statements)
- XSS protection using `htmlspecialchars()`
- Bootstrap 5 responsive UI
- Clean and commented code
---
## 🧩 Technologies Used
- PHP 7.4+ / 8.x
- MySQL / MariaDB
- PHPMailer (via Composer)
- HTML5, CSS3, Bootstrap 5
- JavaScript (basic validation)
---
## ✅ Requirements
- Web server (Apache / Nginx / XAMPP / WAMP / Laragon / cPanel hosting)
- PHP 7.4 or higher
- MySQL / MariaDB
- PHP extensions:
- mysqli
- mbstring
- json
- openssl
---
## ⚙️ Installation
1. **Upload project**
- Localhost (XAMPP):
- Copy the folder to: `htdocs/your_project_name`
- cPanel:
- Upload all files to: `public_html/` or a subfolder.
2. **Create database**
- Open **phpMyAdmin**
- Click **New** → Enter a name (e.g. `login_system`)
- Click **Create**
3. **Import SQL file**
- Select your database
- Go to **Import** tab
- Choose: `database/login_system.sql`
- Click **Import**
4. **Configure database (config.php)**
Edit `config.php`:
```php
$hostname = "localhost";
$username = "root";
$password = "";
$database = "login_system";
For live hosting, use the credentials from your hosting panel.
Configure Base URL
In config.php:
php
Copy code
$base_url = "http://localhost/your_project_name/";
// For live:
// $base_url = "https://yourdomain.com/";
Configure SMTP (Email)
In config.php (or mail config section), set:
php
Copy code
$mail->Host = "smtp.yourhost.com";
$mail->Username = "[email protected]";
$mail->Password = "your-email-password";
$mail->Port = 587; // or 465 for SSL
Test the system
Open: http://localhost/your_project_...
Try:
Register a new user
Check email verification
Login
Forgot password
Reset password
Access dashboard
📂 Folder Structure
bash
Copy code
.
├── # CSS, JS, images
├
│ └── database.sql # Database export
├
│ ├──
│ └──
├── vendor/ # PHPMailer (Composer)
├── config.php # DB + SMTP configuration
├── index.php # Redirect / landing
├── register.php # User registration
├── login.php # User login
├── verify.php # Email verification
├── forgot-password.php # Request reset
├── reset-password.php # Set new password
└── dashboard.php # Protected user area
🔑 Default Settings
No default user is created by default (depends on your DB file).
You can manually insert an admin/user from phpMyAdmin if needed.
| Category | Scripts & Code / PHP Scripts / Login |
| First release | 14 November 2025 |
| Last update | 14 November 2025 |
| Files included | .php, .css, .sql, Javascript .js |
| Tags | php script, login form, registration form, forgot password, php login system, user authentication, email verification, smtp email, PHPMailer, Login and Registration, password reset, user dashboard, bootstrap login, php security, php registration system, php auth, php mysql login, php secure login, php login script, php membership system |








