This repository contains a simple PHP login system using MySQL for user authentication. The system consists of several files, each serving a specific purpose.
- Users are directed here from the login page if they don't have an account.
- Ensures the created account has a valid username and password.
- Inserts user data into the MySQL database.
- Reads from the MySQL database to check if there is a match for the user input.
- Redirects to the index page upon successful login.
- Simple example index page with a welcome message for the user.
- Includes a logout button in the top navigation bar.
- Ends the user's session and redirects to the login page when the logout button is pressed.
- Stores functions necessary for checking user data and other PHP elements.
- Includes functionality for assigning a user ID.
- Connects the user to the MySQL database for reading and writing information.
-
Install XAMPP or a similar local server environment that includes MySQL and Apache web server.
-
Start the MySQL and Apache servers in XAMPP.
-
Open your web browser and navigate to
localhost/phpmyadmin. -
Create a new database; in this example, it is named
login_sample_db. -
Create a table within the database with the following structure:
id: big int (auto-increment, primary key)user_id: big intuser_name: varcharpassword: varchardate: timestamp
-
After setting up the database and placing the files in the correct
xampp/htdocsfolder, navigate to the browser and typelocalhost/login/index.phpto access the functional site.
Feel free to customize the instructions based on your specific setup and requirements. Happy coding!