Contact Form Html Css Php Free Download

Posted on -
Contact Form Html Css Php Free Download Average ratng: 7,3/10 373 reviews

This page presents the sample code for a simple ‘contact us’ form. The form collects a few pieces of information ( email, name and a message ) from your visitor and emails it to you.

Note: You can make contact forms quickly with Simfatic Forms. Simfatic Forms helps you to make complete, feature rich forms and get it online quickly. Read more here.Get more free, ready to use form downloads at ReusableForms.com

Why to have a contact form?

“Contact us” forms are essential for almost any website. The ‘contact us’ form provides an easy interface through which your visitors can communicate to you. Your visitors can quickly submit their views, opinions and suggestions about your website , product or service.

The HTML contact form code

We will create a simple contact form with 3 fields: name, email address and a message field. Making the contact form simple (any form – for that matter) gets you more submissions. The more the number of fields, the more reluctant your visitors will be to submit the form.

The HTML code of the form is given below:

In the contact form download, the form code is in the email-contact-form.html page. To embed the form in a web page, just copy and paste the HTML form code to the web page.

Validating the form submission

Form validations are essential for any web form. For this simple contact form, we will make all the fields mandatory and will make sure that the email field is in the format: name@domain.tld.

It is better to do validations both on the client side and on the server side. Client side validation provides a quick feedback to your visitor. However, the client side validation can just be bypassed by disabling JavaScript in the browser. Therefore, we need to validate on the server side as well.

Views/octopus ep. For client side validation, we will use the Free JavaScript Form Validation Script. The script is very simple to use and has almost all validation types built-in.

Here is the client side form validation code:

Server-side processing

Once the contact form is submitted, the form submission data is sent to the script mentioned in the action attribute of the form (contact-form-handler.php in our form). The script then will collect the form submission data, validate it and send the email.

The first step is to validate the data. Ensure that the mandatory fields are filled-in, and that the email is in proper format.

The server-side code is given below:

Emailing the form data using PHP

We will now compose and send the email.

We first check whether the validations succeeded. If there were errors, the email is not sent. The PHP mail function is used to send the email. After sending the email, the visitor is redirected to the ‘thank you’ page.

Download the code for the contact form

Click here to download php-email-contact-form.zip

The download contains the code for the HTML form, the validations and the PHP form handler.

More Contact forms:

  • A simple, easy PHP contact form
  • A popup contact form
  • A contact form with file upload support

No related posts.

Comments on this entry are closed.Previous CommentsvagelisDecember 20, 2011, 2:47 pm

hello, i did exactly what you have written and when I use wamp I complete the form and send it, it looks like the information has been sent to my e-mail.it shows the message thank you etc,but I have no mail in my account.

will make sure that the email field is in the format: name@domain.tld.

is there anything i can do about this?

thank you, sorry about my english.

RachelDecember 27, 2011, 8:28 pm

I made a new folder called “contact” where I placed all the files and put the ‘contact-form.html’ code on my contact.html page.

Now whenever I submit the message, the “contact-form-handler.php” starts to download and does not send an email.

Please help! THank you!

PrasanthDecember 28, 2011, 2:56 pm

your web server does not support PHP

MayurJanuary 7, 2012, 9:23 am

1) { $boundary = uniqueid(“EWSEWS”); $headers.=”Content-Type:multipart/mixed”. “; boundary = $boundaryrnrn”. “This is a MIME Encoded message.rnrn”. “–$boundary”; foreach($attachment as $att) { $headers.=”rn”. do_Attachment($att). “–$boundary”; } $headers. = “–rn”; } else { $headers.=”do_Attachment($attachment[0])”; }

Patricia BaileyJanuary 7, 2012, 1:23 am

I downloaded the code for the contact form

“Click here to download php-email-contact-form.zip” above.

I designed a contact_us.html, contactform.php., contact.css, thank-you.php, class.phpmailer.php, fgcontactform.php, gen_validatorv31.js, and it is not working yet.

What am I missing?

OmsoftechJanuary 7, 2012, 6:27 pm

Thanks for giving us…

amithJanuary 30, 2012, 5:45 am

Hi when i click submit . Php codes are coming in the browser . why the process is not happening???? me new to php.
reply soon
thx

KennethJanuary 30, 2012, 8:17 am

I did what had to be done including downloading the source code; how do i get the message into my e-mail account just to test the code works.

DinJanuary 30, 2012, 10:21 pm

Thank you for this helpful guide. PHP is quite hard for me to understand!

MustufaFebruary 9, 2012, 5:34 pm

Whenever i click on submit button php page start downloading i am using drop box as a hosting server plz reply

TimFebruary 10, 2012, 6:13 pm

i keep getting the following error message:
“Error: couldnot get Form object contactform”

this makes no sense to me. i copied everything exactly from another website i used this form on. the original site works fine, but the new site keep giving me this error

TimFebruary 10, 2012, 6:28 pm

ok so i managed to get rid of the error message but im still not receiving the emails

VictorMarch 19, 2012, 5:19 am

Tim, I am receiving the same message. How did you resolve yours?

KevinFebruary 23, 2012, 2:51 pm

Thanks for the great form, is there any way I can change the colours etc of the email it sends to me?

Thanks

Son TranducFebruary 27, 2012, 3:17 pm

Beside the webserver with php supported, Do I need a mail server to make this work?

Thanks
Son Tranduc

SeemaFebruary 29, 2012, 6:54 am

Hi,

Thanks for great tutorials. Its work fine.
Can you please help me for how can user receive the thank you message on there mail.

Thanks
Seema

MarziaMarch 2, 2012, 8:40 pm

Hi, it works perfectly apart one thing. I added extra fields for my needs but the javascript alert (if empty) works only in the first two input fields. How is it possibile to make the alert working on all of them?
here’s my form:
http://www.magadesign.co.uk/php-email-contact-form-LASER/contact-form.html
Thanks if anyone can help!!
Marzia

pramod yadavMarch 5, 2012, 2:24 pm

sir…
the above code is running ”’
but i get thank uuuu messs…
no getting the email to the desired email addresss///

please reply ”’
its urgent

MarziaMarch 8, 2012, 12:14 pm

well, my comment still awaiting moderation.but there’s not need anymore. I coudn’t see a very stupid error in my third field, which was affecting the functioning of the js in all following fields. Now it’w working perfectly and I even managed to put a radiobutton!!

ajayMarch 12, 2012, 12:28 pm

i m not getting any msg .in my email account .//
i do as u tell but still not proper responce.//

WebsterMarch 20, 2012, 5:48 pm

Awsome tut, thanks worked as intended! Now I can finally finish my college project: http://www.cavanplumber.com !

Previous Comments
File size: See each • Format: HTML, CSS • Requirements: None • License: Free / Premium • See more: csshtml

Contact forms are crucial for any website. Without a contact form you are forced to directly display your email address and this leaves in vulnerable to email collecting bots.

Believe me I have tried every possible solution to hide or camouflage my email address and at the same time keep it readable to potential customers, and it doesn’t work. Simply put, if you want to connect with your readers / clients / fans via email, you need a contact form.

A contact form has several components : the actual HTML code you place in your HTML file, the CSS styles usually placed in a CSS file and some PHP or AJAX code, used for validating the input fields and actually sending the information collected by the form.

Free HTML Contact Forms

Slick Contact Form Template

Slick Contact form is a professional form that you can easily implement into your website to allow your visitors to contact you. One simple modification from you in order to get it working, and that is changing the default e-mail to your e-mail in order to receive the submissions. The download includes xHTML, Js, PHP and CSS files.

3D Contact Form

This is a a simple PHP contact form with a 3D effect. It uses PHP, HTML and CSS. The form is easy to integrate in your website and easy to customize. The pack includes a detailed tutorial on how to add fields to the form and how to integrate it in your website.

Bootstrap Contact Form with Validation

A very complex free HTML contact form by Jay Deutsch released on codepen.io. The form includes a lot of fields and can be used to collect very detailed information about the person that fills it.

Elegant Contact Form

An elegant HTML contact form designed by Mark Murray on CodePen. The form is really simple, featuring the name, email, subject and message fields organized in two columns.

Colorlib Contact Form

A native HTML5, and CSS3 contact form that’s compact, easy to customize to your own needs, and only requires a simple dynamic configuration for sending the actual emails through. Styling can be configured according to your own requirements.

Responsive Contact Form With Map

A really cool contact form, actually a contact page which features everything you would need in order to be contacted. You have the social links, the contact form as well as additional contact information. Besides this you have a cool map you can use to pinpoint your place of business or places of business if there are more than one as the form allows you to add more. This is done with the Google Maps API.

Sexy Form

Modal Box Contact Form

An elegant contact form in a modal box with a custom dropdown and round submit button.

A Nice & Simple Contact Form

Stylish HTML Contact Form

Bootstrap 3 Contact Form

HTML contact form with CAPTCHA

This contact form provides a pretty secure CAPTCHA form for added security.

PHP Contact Form

This contact form is available in 3 different templates.

Free HTML / CSS Contact Forms

This contact form is available in a light theme, a dark theme, a blue, green and red color.

HTML5 and CSS3 Contact Form

Fast and Secure Contact Form

Fast Secure Contact Form PHP Script allows a user to easily create and add contact forms to a web page. The form will let the user send emails to a site’s admin. An administration panel is present, where the user can create and preview his forms.

Simple Contact Form

Simple Contact Form With Captcha

This form is completely customizable. JavaScript validates required fields; plus there is a verification on the server-side. Captcha image protects the form against SPAM. Captcha image can be reloaded.

Free Bootstrap Contact Form

Here’s a very simple Bootstrap Contact form that you can use on your bootstrap site with same page Ajax Validation return.

Simple HTML Contact Form With Captcha

A simple contact form with a simple anti-spam mechanism.

Premium HTML Contact Forms

Responsive PHP Contact Form

Features: Easy to install, Upload and Run, Responsive Completely, Captcha Secure, Two way Email (Owner and Vsitor), Easy to integrade in new page, Compatible with all major browsers and mobiles.

Purchase($5)

Ultimate PHP, HTML5 & AJAX Contact Form

A very complete contact form that you can easily customize to fit yout needs.

Purchase($10)

Responsive Contact Form

This AJAX jQuery, bootstrap, php, or html static website component allows you to easily place a self-contained Contact Form on any HTML or PHP page of your existing website. It uses just 1 file to Validate, Process and Send the completed contact form to your e-mail address and best of all, does not reload the page to validate or send the form!

Purchase ($5)

ContactZ – Impress and Contact Form

The contact form is a simple form, where the people easily can contact you or your company. To stop spammers you have the ability to add an ReCaptcha. A auto responder is also included.

Purchase($6)

Easy Contact Form With Attachments

This for is available with 4 themes : Light, Dark, Wooden and Transparent.

Purchase ($7)

Email with Multiple Attachments

This form lets you send fully supported HTML based email with multiple attachments. Get this script, customize settings and upload at your server or integrate it in your current project to send or receive HTML based emails containing multiple file attachments. GIF, PNG, JPG, RAR, ZIP, PDF support is built-in. You can add more file type support or remove any one from available easily.

Purchase ($6)

Just Forms Advanced

Just Forms advanced – is a form framework that helps you to create any kind of form (classic, multistep, pop up menu, pop up bottom, modal, without footer and header) with client side processing of the data.

You can use any form from the pack (110+ forms) or you can create your own form. All forms and enhancements can be used without any JavaScript, CSS or HTML special knowledge.

Purchase ($5)

Dynamic Contact Form

Easily create forms from the administration area, You can add text,description,select radiobuttons and checkboxes in your form. Very usefull if you want to personalise your contact form.

Purchase ($7)

Contact Form + Management System

This script comes with the Autoresponder settings where you can enable or disable the responder system and much more features.

Purchase ($14)

Do you know any good HTML contact forms ?

If you designed or you know a great contact form we didn’t include in this article, we’d love to hear from you in the comments below.