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
- Free!
Download the contact form code
You can download the contact form that best fits your needs and then customize as required.

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.
No related posts.






{ 44 comments… read them below or add one }
← Previous Comments
Still can’t get captcha form to work with IIS. PHP is working on IIS. Can get the non captcha form to work. Can get other simple captcha displays to work stand alone but the the captcha just doen’t come up. It works fine on a XAAMP server by changing a couple of the outdated calls. Make the same changes and try it on a IIS no dice.
Great stuff guys. 2 Questions.
1) Can I have more than one form on a page
2) When I want to add fields do I have to make changes inside the fgcontactforms.php or only in the source code.
ie:
Email Address*:
<input type='text' name='email' id='email' value='SafeDisplay(‘email’) ?>’ maxlength=”50″ />
Make changes inside the div tag and copy and paste???
PS Happy Thanks Giving
Great form! Thank you for sharing!!!
The only question I have is how can I remove the border frame that starts after the ‘Contact us’?
One more question, how can I display the required field error message inside the text input text field.
I have added a dropdown list () inside the form.
When I am getting the mail the dropdown list name is there but no value is there.
How can I fix this problem?
Plz help.
Thank you for your generosity on sharing all this code!!!
I used your pop-form in one application and it worked great. I am now trying to use the simple php contact form for a different application and have run into an issue. The form works – it sends email and I can receive it as well. However, I am getting an error message above the form on the page where the form is displayed.
___
Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /home/content/t/e/r/t/html/website/contact.php:7)
in /home/content/t/e/r/t/html/website/include/fgcontactform.php on line 63
___
Would you have any suggestions on how to eliminate this message?
Thanks again.
Thanks! This form is just what I was looking for. I have been struggling with a e-mail contact us form for a while and this just worked in 5 minutes.
One question… the e-mails that are sent sometimes end up in the junk folder. Do you have any suggestions?
Thank you so much!!!
Having a Hard Time with the Captcha’s. Im kinda retarded with this stuff any help would be great. the image isn’t loading on the page from what i see the Script is all correct and i uploaded the files to the /contact dir. to keep it seperate from anything else on my site, im not having any luck with the image file. what might i be missing.
I’m testing the simple testing form locally, when I click the submit, I have this error:
Deprecated: Function eregi() is deprecated in C:\Users\jmelendez.SABIAMED\xampp\htdocs\PhpFormValidator\samples\3-with-client-side-validations\include\formvalidator.php on line 237
Thanks for the help…
Ok, I fix that…
Now when I complete the fields a click submit, the thank_you page is not display.
Some idea? I’m testing locally.
thank you
omg i have searched all day for a “WORKING” contact form that not only processes the data but also uses captcha and jquery validation … you think something like this would be easy to find …. alas no! if you had a G+ or FB Like button id be maniacally stabbing it at this point
THANK YOU SO MUCH for posting this!
← Previous Comments