Skip to content

Ameen-Soft/php-auth-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Auth System

This is a simple PHP authentication system using PDO and MySQL.
It includes user registration, login, role-based redirection, and a basic dashboard for admin users.


Screenshots

Login Page

Login Page

Register Page

Register Page

Index Page (User)

Index Page

Admin Dashboard

Dashboard

Project Structure

  • index.php – Home page, displays welcome message
  • login.php – Login form page
  • register.php – Registration form page
  • dashboard.php – Admin dashboard page

includes/

  • db.php – Database connection using PDO
  • auth.php – Session and role-based access control
  • process_login.php – Handles login form submission
  • process_register.php – Handles registration form submission

assets/css/

  • style.css – Styling for login, register, index, and dashboard pages

database/

  • php-auth-system.sql – SQL file to create users table

Features

  • User registration with name, email, password, and role (user or admin)
  • Secure password hashing using password_hash()
  • Role-based redirection:
    • admin → dashboard.php
    • user → index.php
  • Session management to protect pages
  • Simple and clean responsive UI using CSS
  • Database schema included for easy setup

Installation

  1. Clone the repository:
git clone https://github.com/your-username/php-auth-system.git
  1. Import the database:

    • Open phpMyAdmin or MySQL client
    • Import database/php-auth-system.sql
  2. Configure database connection in includes/db.php:

$localhost = "localhost";
$username = "root";
$password = "";
$dbname = "php-auth-system";
  1. Start your local server and open:
http://localhost/php-auth-system/index.php

Notes

  • No external frameworks are used, only vanilla PHP, HTML, CSS, and MySQL.
  • Passwords are securely hashed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published