PHP · MySQL · Apache · Linux

Login & Registration System

A small, honest auth flow on the classic LAMP stack: sign up, log in, see a private dashboard, log out. Rebuilt with bcrypt passwords, prepared SQL and CSRF tokens.

  • PHP 8
  • PDO
  • MySQL
  • HTML
  • CSS
  • JavaScript

100%

SQL queries prepared

60ch

bcrypt hash length

32B

random CSRF token

4pg

PHP pages, no framework

Live demo

Try it right here

Create an account, log in and open the dashboard. The forms follow the same rules as the PHP version.

Already have an account?

// Why a browser demo?

GitHub Pages only serves static files, so it cannot run PHP or MySQL.

This demo copies the app's rules in JavaScript. Accounts stay in your browser (localStorage), and passwords are salted + SHA-256 hashed before they are saved.

The real app in app/ uses PHP, PDO and password_hash() (bcrypt). Run it locally with XAMPP to see the server version.

Features

Small app, real security basics

How it works

From form to session

  1. ValidateUsername, email and password are checked on the server.
  2. HashThe password becomes a one-way bcrypt hash.
  3. StoreA prepared INSERT saves the user in MySQL.
  4. SessionLogin verifies the hash and starts a new session.