This is a practical project where I built a simple but fully functional login system using PHP and MySQL.
It includes user registration, login with hashed passwords, and a personal dashboard ("My Page") using PHP sessions.
The UI is clean and modern with some stylistic enhancements using Google Fonts and CSS.
| Feature | Description |
|---|---|
| Register | Save new user info (username + hashed password) in MySQL |
| Login | Authenticate user and start session |
| My Page | Protected page showing user info if logged in |
| Logout | Ends session and redirects to login page |
| Design | Modern look using CSS and Google Fonts |
- Language:
PHP 8.x - Database:
MySQL - Server:
XAMPP,MAMP, or similar (Apache + MySQL) - Fonts: Google Fonts - Outfit
project/
├── login1.php # Login with session and redirection to mypage
├── register.php # User registration form and DB insert
├── mypage.php # Displays logged-in user info
├── logout.php # Ends session and redirects to login
└── database.sql # MySQL table creation script
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(100) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL
);$password_hashed = password_hash($_POST['password'], PASSWORD_DEFAULT);$_SESSION['user_id'] = $user['id'];
$_SESSION['username'] = $user['username'];
header("Location: mypage.php");<p class="error">❌ Invalid username or password.</p>🖼️ Basic responsive design with Google Fonts and styled form
- 🔐 Password reset flow
- 📧 Email or OTP-based verification
- 📱 Responsive mobile layout
- 🛡️ Use of prepared statements to prevent SQL injection
This project helped me understand the essentials of building an authentication system using PHP and MySQL.
It covers user management, session handling, and secure password storage using hash functions.
A great starting point for beginners looking to connect frontend forms with a database securely.
👉 Full source code available on GitHub
[🔗 GitHub Repository Link]


