If the $admin_email variable is not assigned a new email address the form will send the information to the email address entered in the "Your E-mail:" field as if it were also the admin. This allows you to test the forms "auto reply" and "form submission" without setting the $admin_email until you are ready to go live. You will therefore receive 2 emails, one being the auto response as the visitor and the other as if you were the admin receiving the form submission.
Requirements and Configuration
- PHP must be installed and running on the website server. Most hosting companies have PHP installed.
- If neccessary change the extension of your webpage to ".php".
eg. If your page is called "contact.htm" change it to "contact.php".
If it wasn't already a .php extension be sure to update any links and menus that refer to your contact page. - Add this line of php code <?php include_once("ContactCode.php"); ?> just after the opening <html> tag on your contact page.
- Where ever you want the contact form to appear in your web page insert the line <?php include_once("ContactForm.php"); ?>
- The Contact Form is fully configurable and consists of the following files.
Open each file in an appropriate editor or a plain text editor such as NotePad (not MS Word).- Your webpage is the file that you want to display the Contact Form on.
Open this page "index.php" or "view source" to see where "ContactCode.php" and "ContactForm.php" have been inserted. - "ContactCode.php" contains the server side code processed by the server. Edit the variables and options in Section 1.
Each option/variable and what it is used for is described in the file. - "ContactForm.php" contains the HTML form and table. Edit the layout to suite your liking but do not change any of the PHP code or remove the php tags. The php code is contained in between the php tags <?php .... ?>
- "ContactForm.js" is the javascript file. Edit the alert messages to suite your liking.
- "ContactForm.css" is the style sheet. Edit the style rules to completely modify the layout and appearance of the Form.
- Your webpage is the file that you want to display the Contact Form on.