Git Product home page Git Product logo

wonderakwei / advanced-php-contact-form-with-database-integration Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 292 KB

Contact form with PHP backend & email notification. Features server-side validation, CSRF protection, & Google reCAPTCHA. MySQL storage & PHPMailer for email notifications. Styled with Bootstrap for responsive design.

License: MIT License

CSS 8.13% PHP 78.70% JavaScript 4.54% Hack 8.62%
apache backend composer contact-us-form csrf-protection email-notification mysql php phpmailer phpmyadmin xampp

advanced-php-contact-form-with-database-integration's Introduction

# Contact Form with PHP Backend and Email Notification

Contact Form

Contact-Us-Form-with-PHP-Backend-MySQL-Google-reCAPTCHA-Integration-and-Email-Notification

Description:

This Secure Contact Form System is an advanced PHP-based solution designed to provide a secure and robust way for users to send inquiries or messages through a company website. This project includes features such as database integration, server-side validation, sanitization, CSRF protection, and Google reCAPTCHA implementation to ensure data integrity and prevent common security vulnerabilities.

Features:

  • Database Integration: Messages submitted through the contact form are securely stored in a MySQL database for future reference.
  • Server-side Validation: Basic validation is implemented to ensure that user input meets certain criteria, such as validating email addresses.
  • Sanitization: User input is sanitized using htmlspecialchars() to prevent XSS (Cross-Site Scripting) attacks.
  • CSRF Protection: CSRF (Cross-Site Request Forgery) tokens are generated and verified to prevent unauthorized form submissions.
  • CAPTCHA: Integration with Google reCAPTCHA provides an additional layer of security to prevent automated submissions by bots.
  • Responsive Design: The contact form is designed to be responsive and user-friendly across various devices and screen sizes.
  • Thank You Page: Upon successful submission, users are redirected to a thank you page to acknowledge their message.

Folder Structure:

Folder Structure:
- **css:** Contains CSS files for styling the contact form.
- **docs:** Markdown files containing explanations on how to set up PHPMailer, Google reCAPTCHA, and CSRF protection.
- **images:** Screenshots of the index.php page and other pages.
- **js:** Includes JavaScript files for client-side functionality.
- **vendor:** Contains third-party libraries like PHPMailer.
- **index.php:** PHP file for the contact form interface.
- **process_form.php:** PHP file for processing form submissions and sending email notifications.
- **README.md:** Documentation file explaining project setup and usage.
- **tables.sql:** SQL file for creating the database table in MySQL.
- **thank_you.php:** PHP file for the thank you page.

Technologies Used:

  • PHP
  • MySQL
  • Bootstrap
  • Google reCAPTCHA
  • PHPMailer
  • phpMyAdmin
  • XAMPP

Usage:

  1. Clone or download the project files to your local machine.
  2. Set up a MySQL database and update the database configuration in process_form.php with your database credentials.
  3. Create Google reCAPTCHA site and secret keys using the guide in the docs folder.
  4. Replace the site key in the index.php and secret key in process_form.php.
  5. Upload the project files to your web server (e.g., via htdocs).
  6. Access the index.php file in your web browser to view and use the contact form.
  7. Upon form submission, messages will be stored in the database, and an email notification will be sent to the specified admin address.
  8. Customize the project as needed by modifying the HTML, CSS, JavaScript, and PHP files.

License:

This project is licensed under the MIT License.


advanced-php-contact-form-with-database-integration's People

Contributors

wonderakwei avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.