This project provides a basic web authentication system using PHP. It includes essential authentication functionalities like user registration, login, and logout, as well as a protected dashboard for authenticated users. The project is designed to be a minimal template, allowing users complete freedom to style and modify the structure as needed.
- User Registration with unique username and email validation.
- Secure User Login with password hashing.
- User Logout to end authenticated sessions.
- A protected dashboard that is only accessible to logged-in users.
- Proper error handling to improve user experience.
- Well-structured project architecture for easy customization.
- The authentication system uses PHP and MySQL for user management.
- Passwords are securely hashed before storing in the database.
- A session-based authentication system ensures secure access.
- The project does not include any CSS to provide full styling flexibility.
- Includes
.htaccess
for better URL handling.
-
Clone the Repository
git clone https://github.com/zaber-dev/Basic-Web-Auth.git cd Basic-Web-Auth
-
Setup the Database
- Create a MySQL database.
- Execute the provided SQL query to create the
users
table.
CREATE TABLE users ( id INT PRIMARY KEY AUTO_INCREMENT, username VARCHAR(50) NOT NULL UNIQUE, email VARCHAR(100) NOT NULL UNIQUE, password VARCHAR(255) NOT NULL, created_at DATETIME DEFAULT CURRENT_TIMESTAMP );
-
Configure the Database Connection
- Update
config.php
with your database credentials.
- Update
-
Run the Project
- Open
index.php
in your browser. - Register a new user and log in to access the dashboard.
- Open
Contributions are welcome! If you find any issues or have improvements, feel free to submit a pull request.