Forms & PHP
Nexgen ships with a ready-to-use contact form powered by two PHP files in assets/php. A little
configuration makes the form deliver mail to your inbox and shrug off spam.
Directoryassets
Directoryphp
- form.php sends the email
- recaptcha.php verifies the visitor
form.php — sending email
Section titled “form.php — sending email”form.php is what actually delivers the message a visitor types into the contact form.
-
Open
assets/php/form.phpin your code editor. -
Set your recipient address. Find the field for the destination email and replace it with the address where you want messages delivered.
-
Translate the text (optional). The success and error messages the visitor sees are defined in this file — adjust their wording or translate them to your language as needed.
-
Save and upload the file to your host, then send yourself a test message to confirm it arrives.
recaptcha.php — blocking spam
Section titled “recaptcha.php — blocking spam”recaptcha.php connects the form to the Google reCAPTCHA API so automated bots can’t flood your inbox.
It needs your secret key pasted into the spot the file indicates.
Because reCAPTCHA also requires a site key in your HTML and JavaScript, the full walkthrough lives on its own page:
For the rest of what’s in the package — the file structure and the other asset folders — see The Package and Assets.