Email Form Script - Huggins' Email Form Script

James Huggins' Email Form Script  is a free PHP script used to process Web Forms. It is specifically for those forms which accept information and send an email with that information to the specified email address.  I have been using it for many years now on all of my sites.

To use this script, your web host must  support at least PHP 5.1.

If you are using any of my template packages, you can use this sample contact form on your site. The sample package contains the following six pages/files:

  • sample contact form
  • sample thank you page
  • sample error template
  • form.css - external style sheet for the form and error template
  • instructions for editing sample contact form
  • background image used for form fields

THE PACKAGE DOES NOT CONTAIN JAMES' SCRIPT. You will need to download the latest version of James Huggins' Email Form Script and publish the php script to your server. You can then edit the sample contact form using the instructions below. The form script and the contact form should be published to the root directory of your website. If you publish the script to a folder where you keep your javascript files, then you will need to edit the file path to reflect that location.

Editing the Contact Form Code

In order for the contact form to work for you, the following lines (highlighted)  must be edited with YOUR information. Editing should be done BEFORE you attach any DWT you choose to use. Be extremely careful in editing the various lines that you do NOT delete (.) periods, (,) commas and (" ") quote marks.

For much more information on just what this form script is capable of, and for the full documentation file see Huggins' Email Form Script.

The styling for the sample form as well as the error page comes from the attached external style sheet form.css. You can leave it attached or you can copy the styles into your already existing style sheet.


Line 14: <form id="contact" action="http://www.your-domain-name.com/huggins-email-form-script-v2.2.3.php5" method="post">

Publish the php script to the root of your domain and change the highlighted text to your domain name. Make sure you are using the latest version of James script by checking the version available at Huggins' Email Form Script. Make sure the path above points to exactly where the script is located and that the version numbers match.

Line 25: <input name="FormNextURL" type="hidden" value="http://www.your-domain-name.com/thank-you.html" />

Create a thank-you.html page and change the above highlighted text to your domain name or edit the enclosed thank-you.html.

Line 44: <input name="FormEchoUser" type="hidden" value="yes" />

Change to no if you do NOT want the user to receive a copy of the generated email.

Line 48: <input name="FormErrorPageHeading1" type="hidden" value="Test Error Form, , , , ,error-page-heading1" />

Change to the Text you want to appear as the H1 heading on your Error Page

Line 52: <input name="FormErrorPageTitle" type="hidden" value="Error Page - Sample Error Page" />

Change to what you want to appear at the top of the browser window for the error page.

Line 64: <input name="Msg1AddrList" type="hidden" value="FP2EW Tutors, tutors, frontpage-to-expression.com" />

Change to reflect your own email information

Line 72: <input name="Msg1Subject" type="hidden" value="Sample Contact Form" />

Change to what YOU want to see in the Subject of the email you receive.

Line 75: <input name="Msg1TextTop" type="hidden" value="I am testing the sample form to see how it works:" />

Change to what you want to see as the top line of text in the content of the email you receive.

Lines 89-97: These lines are used to indicate what will appear on the email the user of the form receives IF you want it to be different than the one you receive.

Working Sample of Form You will receive a copy of the email sent which is formatted in the same way as the copy of the form that is sent to the specified email address within the form.

Examples of More Complex Forms:

As you can see from the above examples, there is much more available that you can do with Huggins' Email Form Script

Pat Geary.
Copyright © Pat Geary of Expression Web Tutorials and Templates
Written March 2011

Search:

Site Menu

Expression Web

Domain Registrations starting at $9.98*

Signup for BlueHost hosting account.

Microsoft MVP Logo.