Here is a ‘ready to use’ form that you can simply plug-in to your web site. All that you have to do is to download the code below, update the code to include your email, and attach form to your web site. You can easily customize the form for your needs. The code is 100% validated XHTML1.0 strict.
Features of this contact form
- Standards compliant, accessible form
- 100% XHTML 1.0 strict validated, uses CSS2
- Secured against spam and attacks
- Validations done both on client side and on the server side
- Uses PHPMail to send email
- Easy to customize
- Hosted on your own web server
Download the contact form code
You can download the contact form that best fits your needs and then customize as required.
Installing the contact form on your web site
Unzip the downloaded contact form code.
Edit contactform.php and edit the email address to your email address
$formproc->AddRecipient('email@example.com');//<<---Put your email address here
Upload the folder contents to your website (to a sub-folder say, /contact)
The contactform.php contains the form. You can link to this file or embed the form using iframe.
Sample iframe code to embed the form:
<iframe src='/contact/contactus.php' frameborder='0' width='100%' height='600' ></iframe>
Alternatively, you can modify contactform.php to have the same look of your web site.
Customizing the form
The contact form can be customized to match requirements. You can change the style, add more fields, and add more email recipients.
Changing the colors, fonts and style
You can edit the contact.css file to change the style of the form.
Adding more than one recipients
Call the AddRecipient() function passing the email address of the new recipient.Example:
Adding more fields
You can add any type of additional fields to the form. The fields will automatically be included in the form submission emails.
More Customizations …
For more features and customizations of the contact form, see the Related Pages section below.