Login
A functional login and registration system using procedural PHP and MySQL.
About this Project
This project demonstrates how to build a user authentication system from scratch using procedural PHP. It connects to a MySQL database to handle user registration and login, implementing essential security measures like password hashing and prepared statements.
Features
- User registration and login functionality
- Password hashing using `password_hash` and `password_verify`
- Protection against SQL injection via Prepared Statements
- Session management for maintaining login state
- Bootstrap-styled forms for better UI
Challenges & Solutions
The Challenge
The primary challenge was ensuring the security of user data. Understanding how to properly hash passwords instead of storing them in plain text, and preventing SQL injection attacks were key learning points.
The Solution
I utilized PHP's built-in `password_hash` function to securely store credentials and used MySQLi prepared statements (`$stmt->prepare`) to separate SQL logic from data, effectively neutralizing SQL injection risks.