Contact Form PHP file

Hello,
I’ve always been interested in creating a contact form, although I’ve never understood how to create the PHP file that verifies the fields and sends the form contents. I have searched for tutorials, although none really make a lot of sense to me, unfortunately. I love how the contact form works on this page:

Especially how the “Please Enter Your Name” etc. slide in if you do not complete the form properly. I would like to learn how I could do something that functions not unlike this one. Could anyone point me in the right direction? I am fine at designing and building the form on the page, but its the PHP file to send it (and the fancy “Please Enter Your Name” popups that I cannot get a handle on.

Thanks in advance for any help!

These are actually done in javascript not php.

Google javascript form validation and you should have loads of stuff.

There are also some ‘javascript validators’ which you can use as a sort of framework if you are not too keen on coding.

To be honest, you are likely to be better off in the javascript forums.

G

i acn also recommend www.w3schools.com - lots of various website language tutorials for beginners!

Hey There,

I actually built this site :slight_smile:

Validation was, in this case, some basic if statements in Javascript - I would usualy use jomething like the jQuery Validation plugin, but decided to keep it simple this time.

The tooltips are just poshytip for jQuery - look great, and easy to implement!

Server-side is quite simple too - just validating, checking for spam, then posting off the mail.

This site was a couple of days work - was quite lucky I didn’t need to support IE6!

Have fun with jQuery!
James

I would recommend JQuery as it is quite simple to use, however, be warned… JQuery does a very good job of making a lot of javascript functions simple to implement, but you should still have a good underlying knowledge of javascript.

I agree :slight_smile:

Without the background knowledge, things can get quite messy.

As with any framework - if you don’t understand what is behind the framework, then you probably won’t be using it to its full potential - in some cases, just working against it.

Validation in the client is okay BUT you will still need to validate on the server to keep out the bad guys.