Welcome to the Login System with Forgot Password, a robust and user-friendly solution for managing user authentication. This project offers seamless functionality for user registration, login, and password recovery with a sleek and modern interface. Built with HTML, CSS, and JavaScript on the front end, and powered by PHP and MySQL on the back end, it provides a secure and responsive design, ensuring smooth navigation across all devices. The integration of features like password visibility toggles, form transitions, and email-based password recovery enhances the overall user experience.
With security at its core, this system leverages prepared statements to prevent SQL injection and uses PHPMailer for sending reliable password reset emails. Setting up and using this application is straightforward—just configure the database, integrate your SMTP credentials, and you’re good to go. Whether you are a developer looking for a ready-made authentication system or a learner aiming to understand login workflows, this project provides a perfect starting point.
Allows users to create an account by providing their email and a secure password.
Ensures password confirmation to avoid input errors during registration.
User Login:
Secure login functionality with email and password validation.
Displays error messages for incorrect credentials.
Forgot Password:
Enables users to reset their password in case it’s forgotten.
Generates a secure, time-bound reset token and sends a password reset link to the user’s email.
Password Visibility Toggle:
Provides a "Show/Hide Password" feature for better usability during password input.
Interactive Forms:
Smooth transitions between login, registration, and reset password forms.
Responsive Design:
Fully responsive UI design suitable for different screen sizes and devices.
Secure Data Handling:
User credentials are handled securely using prepared statements to prevent SQL injection attacks.
Technologies Used:
Front-End:
HTML5: Structure of the web forms and content.
CSS3: Design and styling, including transparent, modern aesthetic.
JavaScript: Interactivity features such as form toggles and password visibility toggle.
Back-End:
PHP: Handles user authentication logic, form submissions, and email operations.
MySQL: Database used to store user credentials, reset tokens, and other essential data.
Libraries and APIs:
PHPMailer: Sends reset password emails via SMTP.
Google Fonts: Ensures modern typography for better aesthetics.
How to Use:
Setup the Database:
Create a MySQL database with required tables, including users for storing user details and password_resets for password reset requests.
Configure Backend:
Modify the database connection details in the conn.php file.
Update the PHPMailer SMTP credentials (Host, Username, Password) for sending emails.
Run the Application:
Start a local server (e.g., XAMPP, WAMP) and navigate to the project directory in your browser.
Use the registration form to create an account.
Log in using the registered credentials or initiate the password reset process for forgotten credentials.
Password Reset:
Provide your registered email to receive a password reset link.
Use the link to set a new password before the token expiration time.
Sample Screenshots of the Project:
Login Form
Registration Form
Reset Password Form
Set New Password Form
Email Notification
Dashboard
How to Run?
Download and InstallXAMPP.
Download the provided source code zip file.
Note: The database is included on the provided zip file.
Installation/Setup:
Create a database named "login_forgot_password_db" in phpMyAdmin MySQL.
Extract the provided source code to the htdocs folder.
Import the provided SQLfile into the created database.
Setup your email sender (username and password) at forgot-password.ph.
Open your browser with the link "http://localhost/login-system-with-forgot-password/".
Video Demonstration for Installation/Setup:
Conclusion:
In conclusion, the Login System with Forgot Password Using PHP, MySQL and PHPMailer is a comprehensive solution that combines functionality, security, and an intuitive user interface. By leveraging modern web technologies and best practices, it ensures a seamless user experience while maintaining robust security standards. Whether you're implementing it in a larger project or using it as a standalone application, this system provides a solid foundation for managing user authentication and password recovery. Its customizable design and scalable features make it a valuable addition to any web application.
That's it! I hope this "Login System with Forgot Password Using PHP, MySQL and PHPMailer" will assist you on your programming journey, providing value to your current and upcoming PHP projects.
For additional tutorials and free source code, explore our websites.
Enjoy Coding :>>
Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.
Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.
FOR YOUR OWN SAFETY, PLEASE:
1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.