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.
Also see: free form downloads from ReusableForms.com
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
- Free!
Download the contact form code
You can download the contact form that best fits your needs and then customize as required.
Simple contact form with three fields: Name, Email and Message
Try the Demo | Download
Contact form with Simple Captcha
Try the Demo | Download
Contact form with fields: Name, Email, Phone and Message (and Image Captcha)
Try the Demo | Download
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('name@your-website.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:
$formproc->AddRecipient('name_1@your-website.com');
$formproc->AddRecipient('name_2@your-website.com');
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.
License
The code is shared under LGPL license. You can freely use it on commercial or non-commercial websites.
See Also
- How to embed the contact form in your web pages
- Creating a registration form using PHP
- Making a login form using PHP
- A simple, easy PHP contact form
- Here is a simple popup contact form (modal popup)
- PHP Contact Form Tutorial
- How to setup a Boottrap Contact Form without PHP (email, auto-response, record keeping) in 3 minutes