How do I put your contact form on my website?
Installing my PHP contact form into your existing website is super simple – no programming knowledge required!
Nothing too scary, I promise:
- Your web server / web host must support PHP. The form supports everything from PHP4 / PHP 5 to PHP 7.4 (and if this means nothing to you, you probably won’t have to worry about it!)
- Your host must allow use of the PHP mail() function — a few web hosts disable this to try and combat spam. If in doubt, ask your web host
That’s really it.
- Download the mail form to your computer, extract the zip file and open the mail form “.txt” file
- Customise the variables at the top of the file in a plain text editor (such as Microsoft Notepad). Do not use Microsoft Word or other rich text editors.
To set the variables, add your chosen configuration between the quotation marks, e.g. if the e-mail address you want to receive the form mail at is firstname.lastname@example.org, change
$yourEmail = "";to
$yourEmail = "email@example.com";
In the Premium version of the form, change
$primary_recipient = "";to e.g.
$primary_recipient = "firstname.lastname@example.org";
Save your changes.
- Rename the .txt file to something suitable, e.g. contact.php. The file must be saved with a “.php” extension to work!
- Upload to your web server … it’s ready to go!
Having Trouble Renaming the File?
If you use Microsoft Windows and don’t have common file extensions shown, when you rename the file, it may end up e.g. contact.php.txt. To get around this, you can open the file in Notepad, go to Save As… and enter the File name as "contact.php" (with the quotation marks). This overrides the default file extension.
Alternatively, upload the file to your server as .txt, and rename the file on your server.
Questions? Want to customise the appearance of the form? See the help & how-to