Basic, simple and secure bootstrap contact form.
Using Ajax protocol, PHP & JS validations inputs, SMTP mail sending, rejected not found domain and Google reCAPTCHA v3.
Jquery FREE.
You can try this form here: https://dev.raspgot.fr/github/contact-form-php
- PHP 8.3.12 ✔️ (See supported versions)
- Bootstrap 5
- Ajax submission
- Google reCAPTCHA v3
- PHPMailer SMTP Authentication
- Validation and inputs security (PHP & JS)
Use clone command or direct download
git clone https://github.com/raspgot/Contact-Form-PHP.git
cd Contact-Form-PHP
php -S localhost:8000
SMTP sender → HERE
GOOGLE keys → HERE
More PHPMailer configurations → HERE
/AjaxForm.php
Timezones doc → HERE
date_default_timezone_set(''); # your country
const HOST = ''; # SMTP server
const USERNAME = ''; # SMTP username
const PASSWORD = ''; # SMTP password
const SECRET_KEY = ''; # GOOGLE secret key
/AjaxForm.js
const reCAPTCHA_site_key = 'GOOGLE_PUBLIC_KEY';
/index.html
<script src="https://www.google.com/recaptcha/api.js?render=GOOGLE_PUBLIC_KEY"></script>
You can cuztomise text error:
<div class="valid-feedback">Name looks good</div>
<div class="invalid-feedback">Please provide a valid name</div>
YOU MUST ALLOW cURL OR allow_url_fopen AND php_openssl DIRECTIVE ON YOUR SERVER IN php.ini
extension=curl;
allow_url_fopen = On
extension=php_openssl.dll
You can visit my Portfolio and star this repo if you like it 🤖