
Step 1: MySQL - Database Table Creation
-
Create Users Table (
users
table): -
Create Employees Table (
employees
table):
Step 2: PHP Database Connection (config.php
)
This script establishes a connection to the MySQL database.
Step 3: Registration Logic (php_register.php
)
This file handles the form submission for user registration. It validates the inputs and checks if the email already exists. If no errors are found, it inserts the new user into the users
table.
Step 4: Sign-Up Form (sign-up.html
)
The sign-up form allows users to enter their email and password and confirm the password.
Step 5: Login Form (login.php
)
The login form allows users to log in using their email and password.
Step 6: PHP Login Handler (php_login.php
)
This file processes the login request and validates the email and password.
Step 7: Welcome Page (welcome.php
)
This page shows a welcome message and allows the user to log out.
Step 8: Logout (logout.php
)
This script handles logging out the user by destroying the session.
This PHP and MySQL code covers the basic registration and login system. Each step is designed to handle user input validation, session management, and error reporting effectively.