Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zaber-dev/basic-web-auth
This project is a basic web authentication system built with PHP. It includes user registration, login, and logout functionalities, as well as a protected dashboard for authenticated users.
https://github.com/zaber-dev/basic-web-auth
auth authentication github-codespaces learn mysql mysql-database php student-vscode web-auth web-authentication webapp website website-template
Last synced: 3 days ago
JSON representation
This project is a basic web authentication system built with PHP. It includes user registration, login, and logout functionalities, as well as a protected dashboard for authenticated users.
- Host: GitHub
- URL: https://github.com/zaber-dev/basic-web-auth
- Owner: zaber-dev
- License: mit
- Created: 2025-02-03T14:59:07.000Z (11 days ago)
- Default Branch: main
- Last Pushed: 2025-02-05T08:30:35.000Z (9 days ago)
- Last Synced: 2025-02-12T04:18:45.305Z (3 days ago)
- Topics: auth, authentication, github-codespaces, learn, mysql, mysql-database, php, student-vscode, web-auth, web-authentication, webapp, website, website-template
- Language: PHP
- Homepage:
- Size: 8.79 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Basic Web Auth
This project is a basic web authentication system built with PHP. It includes user registration, login, and logout functionalities, as well as a protected dashboard for authenticated users.
## Features
- User Registration
- User Login
- User Logout
- Protected Dashboard
- Error Handling## File Structure
```
/Basic Web Auth
├── auth
│ ├── login.php
│ ├── logout.php
│ ├── register.php
├── template
│ ├── admin
│ │ └── dashboard.php
│ ├── auth
│ │ ├── login.php
│ │ └── register.php
│ ├── home.php
├── .htaccess
├── config.php
├── index.php
├── dashboard.php
└── README.md
```## Setup
1. Clone the repository to your local machine.
2. Create a MySQL database and execute the provided SQL query to create the necessary tables:
```sql
CREATE TABLE users (
id INT PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(50) NOT NULL UNIQUE,
email VARCHAR(100) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
```
3. Update the `config.php` file with your database credentials.## Usage
### Index Page
1. Navigate to the home page: `/index.php`
2. You will find links to login and register.### Registration
1. Navigate to the registration page: `/auth/register.php`
2. Fill in the required fields and submit the form.
3. Proper error messages will be displayed if the username is already taken or if the passwords do not match.### Login
1. Navigate to the login page: `/auth/login.php`
2. Enter your username and password, then submit the form.
3. Proper error messages will be displayed if the username or password is incorrect.### Dashboard
1. After logging in, you will be redirected to the dashboard: `/dashboard.php`
2. The dashboard is protected and only accessible to authenticated users.### Logout
1. Click the logout link on the dashboard to end your session.
## License
This project is licensed under the MIT License.