This project is a simple user authentication system built with PHP, MySQL, and Bootstrap. It includes functionalities for user registration, login, and logout.
- User Registration
- User Login
- User Logout
- Password Hashing
- Session Management
- PHP 8.2 or higher
- MySQL 8.1 or higher
- Composer
- WAMP or any other local server environment
-
Clone the repository:
git clone https://github.com/chakerncb/Simple-User-Authentication-System-With-PHP.git
-
Navigate to the project directory:
cd Simple-User-Authentication-System-With-PHP -
Install dependencies using Composer:
composer install
-
Create a
.envfile from the example file and configure your database settings:cp .env.example .env
-
Import the database schema:
- Open your MySQL client and run the SQL script located at
database.sql.
- Open your MySQL client and run the SQL script located at
-
Start your local server and navigate to the project directory in your browser.
- Register: Navigate to
register.phpto create a new account. - Login: Navigate to
login.phpto log in with your credentials. - Dashboard: After logging in, you will be redirected to
index.php, which is the user dashboard. - Logout: Click the logout button on the dashboard to end your session.
auth/: Contains authentication scripts for login, logout, and registration.config/: Contains the database configuration file.assets/: Contains Bootstrap CSS and JS files.index.php: The user dashboard.login.php: The login page.register.php: The registration page.database.sql: The SQL script to set up the database schema..env.example: Example environment configuration file.