Skip to content

Rizinkovic/php-login-register-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Login-Register System

Description

This is a simple yet secure login and registration system built using PHP, CSS, and Bootstrap. The system allows users to register with a name, email, and password, log in with their credentials, access a user-specific page, and log out. It includes security features like password hashing, CSRF protection, and session management, with a responsive design powered by Bootstrap 5 and custom CSS. The system uses a MySQL database to store user data.

image image image

Key Features

  • User registration with email and password.
  • Secure login with session-based authentication.
  • User-specific page with welcome message and logout option.
  • Password hashing with password_hash() and verification with password_verify().
  • CSRF protection to prevent cross-site request forgery.
  • Responsive design with Bootstrap and custom CSS.
  • Session management for user tracking and logout functionality.

Requirements

Setup Instructions

1. Install XAMPP or WAMP

  • Download and install XAMPP or WAMP on your computer to create a local server environment.
  • Start the Apache and MySQL services after installation.

2. Create the Database

  • Open phpMyAdmin by visiting http://localhost/phpmyadmin in your browser.
  • Create a new database named login_db.
  • Create a table named users with the following schema:
    Column Type Attributes Default Extra
    id INT Primary Key None AUTO_INCREMENT
    name VARCHAR(50) Not Null None
    email VARCHAR(100) Not Null None
    password VARCHAR(255) Not Null None
    user_type VARCHAR(50) Not Null 'user'
  • Ensure the email column length is sufficient to avoid truncation of email addresses.

3. Configure the Project

  • Place the project files in the htdocs folder (XAMPP) or www folder (WAMP).
  • Edit connection.php with your MySQL credentials:
    <?php
    $host = 'localhost';
    $user = 'your_username'; // e.g., 'root'
    $pass = 'your_password'; // e.g., '' for default XAMPP/WAMP
    $db = 'login_db';
    $conn = new mysqli($host, $user, $pass, $db);
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    }
    ?>

About

This is a simple yet secure login and registration system developed using PHP, CSS, and Bootstrap.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published