Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” OTP System with PHP & MySQL πŸ’»

This project is an OTP (One-Time Password) System built with PHP and MySQL. It allows users to request an OTP for actions such as login, registration, or verification. The OTP is sent via email or SMS (depending on the implementation), ensuring secure and validated actions.

🌟 Features 🌟

  • πŸ“§ OTP Generation: Generates a unique OTP and sends it to the user’s registered email address.
  • πŸ”‘ OTP Validation: Validates the OTP entered by the user against the generated one.
  • πŸ“… Expiry Time: OTPs have a set expiry time for added security.
  • πŸ›‘οΈ Secure Authentication: Ensures the authenticity of user actions (login, registration) using OTP.
  • πŸ”’ Database Integration: MySQL stores OTPs and tracks their expiry time for validation.
  • πŸ–₯️ User Interface: A simple and user-friendly interface to request and verify OTPs.

βš™οΈ Prerequisites βš™οΈ

Before running this project, ensure you have the following installed:

  • PHP (>=7.4) πŸ–₯️
  • MySQL πŸ—„οΈ
  • A web server (e.g., Apache or Nginx) 🌐
  • A database client (e.g., phpMyAdmin, MySQL Workbench, or command-line client) πŸ”§
  • Mail server configuration for sending OTP emails (can use SMTP, PHPMailer, etc.)

πŸ› οΈ Setup Instructions πŸ› οΈ

  1. Clone the Repository:

    git clone https://github.com/yourusername/your-repo-name.git
    cd your-repo-name
  2. Set Up the Database:

    • Open your MySQL client.

    • Create a new database:

      CREATE DATABASE otp_system;
    • Import the provided database.sql file:

      mysql -u username -p otp_system < database.sql
  3. Configure the Project:

    • Open the config.php file.

    • Update the database connection details:

      define('DB_HOST', 'localhost');
      define('DB_USER', 'your_database_username');
      define('DB_PASS', 'your_database_password');
      define('DB_NAME', 'otp_system');
    • Set up your SMTP settings (for sending emails) in mailer.php or similar file.

  4. Run the Project:

    • Place the project files in your web server's root directory (e.g., htdocs for XAMPP).
    • Start your web server and navigate to http://localhost/your-repo-name.

πŸ“ Folder Structure πŸ“

/your-repo-name
β”œβ”€β”€ config.php          # Database configuration
β”œβ”€β”€ otp-request.php     # OTP request form
β”œβ”€β”€ otp-validate.php    # OTP validation script
β”œβ”€β”€ database.sql        # Database schema
β”œβ”€β”€ mailer.php          # Email sending functionality
└── README.md           # Project documentation

πŸ“Έ Screenshots πŸ“Έ

πŸ“ OTP Request Page

OTP Request Page

πŸ”‘ OTP Validation Page

OTP Validation Page

πŸ“œ License πŸ“œ

This project is licensed under the MIT License. Feel free to use and modify it as per your needs. πŸ› οΈ

🀝 Contributions 🀝

Contributions are welcome! Feel free to submit issues or pull requests for improvements or bug fixes. πŸ’‘

About

website full frantend and backend code

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages