A full-stack authentication and role management system built with PHP, MySQL, HTML, CSS, and JavaScript. This project demonstrates secure user authentication, session management, database integration, and role-based access control within a traditional LAMP/WAMP development environment.
- User registration with server-side validation
- Secure password hashing using
password_hash() - User authentication with
password_verify() - Persistent session management using PHP sessions
- Role-based access control and protected dashboards
- Separate user and administrator interfaces
- Structured project architecture for scalability and maintainability
- MySQL database integration with prepared statements for security
- Backend: PHP
- Database: MySQL / MariaDB
- Frontend: HTML, CSS, JavaScript
- Environment: XAMPP, WAMP, or LAMP
The system supports two account roles:
- User – Standard account with access to the user dashboard.
- Admin – Administrative account with access to the admin dashboard.
For security purposes, administrator accounts cannot be created through the registration form. Admin privileges must be assigned directly within the database by an authorized developer or database administrator.
Users can create accounts through a registration form. Passwords are never stored in plain text and are securely hashed before being saved to the database.
The login system validates user credentials against stored account records and creates secure session variables upon successful authentication.
After login, users are automatically redirected based on their assigned role:
dashboard.phpfor standard usersadmin_dashboard.phpfor administrators
Protected pages require an active authenticated session, preventing unauthorized access to restricted areas.
actions/– Authentication handlersassets/– CSS, JavaScript, and image assetsdatabase/– Database connection and schema filesincludes/– Shared components and session utilitiespublic/– Public-facing pages and dashboards
- Password hashing with PHP's built-in password API
- Prepared SQL statements to reduce SQL injection risks
- Session-based authentication
- Server-side form validation
- Role-based route protection
This project was developed to strengthen practical skills in:
- PHP backend development
- MySQL database design and integration
- Authentication and authorization workflows
- Session management
- Secure coding practices
- Full-stack application architecture
This project is provided for educational and portfolio purposes and may be modified or extended as needed.