Easy PHP Contact Form (Captcha) Installation Instructions (Ver 2.0)
This method is recommended if you want to include the contact form on any existing PHP page of your website (say your existing contact page). The limitation of this method is that you can only display a confirmation message and not redirect to any specific thank you page you may have. If you would rather access the contact form as a separate page, skip to Method II. Compared to this method, Method II is bit easier to implement.
contact-config.php (within the formfiles directory) and edit the below 3 variables:
$to = 'email@example.com';
firstname.lastname@example.org to the email address where you wish the contact form messages to be
$subject_prefix = 'My Website Contact';
This will be the prefix that'll be attached to the subject of all contact form email messages.
$where_included = '';
You first have to select an existing PHP page on your website where you'll be displaying the contact form. This is the name of the file where you are including the contact form. If you don't have a PHP page, don't worry. You can simply rename your existing HTML page to PHP page. For example:
So if you are including the contact form in a file called
contact_us.php, then the above variable
$where_included = 'contact_us.php';
Now open the file where you are going to include the contact form, in this case
contact_us.php, and put the
below code to the place where you want the contact form to be displayed:
<?php include "contact-form.php"; ?>
Then add the below code to the very top of the same file:
<?php session_start(); ?>
That's it! Upload all the files to your server (retaining the directory structure). If you load
contact_us.php, the contact form should be visible.
This method is recommended if you want to access the contact form as a separate page and would like to redirect users to a separate thank you page you may have. You can use this method even if you don't want to redirect users to a separate thank you page.
$use_header_footer = FALSE;
$use_header_footer = TRUE;
$thank_you_url = '';
Add the url to your thank you page to the above variable. Example:
$thank_you_url = 'http://www.yourdomain.com/thank_you.html';
$where_included = '';
$where_included = 'contact-form.php';
contact-footer.php (within the formfiles directory) and put your site header and footer information in them.
That's it! Upload all the files to your server, retaining the directory structure. You can now access your contact form directly by visiting:
...depending on where you have uploaded the contact form files.
Modifying the Looks of Your Contact Form
To modify the looks of your contact form - background color, border, fonts, etc. please modify the variables under the "COSMETICS" section in contact-config.php file. All the variables are self-explanatory.