Dreamweaver/Website form.


"Hello, I am going to re do my website and have made a web form for it but I dont know how to enable the web form so it works. The fields I have got are Name, Email Address and Message with a submit button. I want to be able to have the form working so that it sends the message to my website email address etc. Up until now i have been fine making a basic website but this is new to me so your help would be appreciated.



    Good day Mr.Robert !

For creating a contact us form, you need to create a html (frontend) and a php (backend) file.

Create a html file with any name and copy the below mentioned coding in it.

<title>Contact Us</title>
<form action=process.php method=POST>
<td><input type=text name=val1></input></td>
<td><input type=text name=val2></input></td>
<td><textarea cols="40" rows="5" name="val3"></textarea></td>
<td><input type=submit name=submit value=submit></input></td>

Create a php file with the name mentioned in the front end's coding part (here, it is process.php) and copy the below mentioned coding in it. If you want to have your own backend name, you can do so, but don't forget to change the same in front end's HTML coding. Also change the mail id 'you@example.com' to your own email id.


//Concantenate all values as a string and store it in a variable named consolidatedtext.

$consolidatedtext="\n Username is"." ".$name.",  "."\n Email is"." ".$email.",  "."\n Address is \n"." ".$address;

//Use PHP mail function to send all the received details to the appropriate mail id.
//Change the mail id 'you@example.com' to your id

mail("you@example.com","New Contactus Submission",$consolidatedtext);

Now, upload the two files to the webserver (if you have one). But, please do remember that both the files should reside in the same directory.

Please revert to me, for any clarifications.

I am more than happy to assist you.

Cheers !


All Answers

Answers by Expert:

Ask Experts


Vimal Abraham


I have worked with HTML, PHP and MySQL from 2005. I can be able to solve HTML, PHP, and MySQL related issues.


I have worked under various domains of web development including file sharing, social community, wallpaper management, image hosting, web hosting automation, shopping cart and payment gateway integration. My portfolios include, http://www.4kwallpapers.in http://www.wallpicz.com

I have completed Bachelor of Engineering in Computer Science.

Awards and Honors
Have a Total of nine certificates in Inter and Intra College Competitions that includes technical quiz, program debugging and paper presentation (State Level).

©2017 About.com. All rights reserved.