Skip to content

Tonwhan/php-register-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Registration & Login System

📂 Project Structure Explained

File Purpose Key Concept
config/server.php The "Bridge" Connects your PHP code to the MySQL Database (XAMPP).
auth/register.php The "Front-Door" The HTML form where users type their information.
backend/register_db.php The "Officer" Processes registration logic.
auth/login.php The "ID Check" HTML form for returning users.
backend/login_db.php The "Security" Verifies login credentials.
home/index.php The "Private Room" The homepage for logged-in users.
backend/error.php The "Feedback" Shows error messages.
css/style.css The "Makeup" Styling for the application.

Core Concepts for Hackathons

1. The Superglobals ($_POST, $_SESSION)

  • $_POST: Used to grab data from forms (e.g., $_POST['username']).
  • $_SESSION: Used to "remember" a user across different pages. Crucial: Always put session_start(); at the very top of files that use sessions.

2. Database Connection (mysqli_connect)

Found in server.php. If your system isn't working, check these 4 things:

  1. Host: Usually localhost
  2. User: Usually root
  3. Password: Empty "" by default in XAMPP
  4. DB Name: Must match exactly what you named it in phpMyAdmin (register_db)

3. Password Security (md5)

Never store passwords as plain text! In this project, you use md5($password). While there are stronger methods (like password_hash), MD5 is a great starting point for learning.

4. Preventing Duplicates (The "Logic Check")

Before inserting a new user, you must run a SELECT query to see if the username or email already exists. If the database returns a result, you stop the registration and show an error.

About

PHP Registration & Login System

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published