I need to add a simple form to a contact us page. What is the easiest way to do this?

I have a contact us page, with a form that will ask for a potential customers name, email address, business name, phone number, and a text area field for comments. I need to have this form submit to an email address. A Thank You page would be good, if possible. Nothing fancy, something very simple. What is the fastest and easiest way to create such a form? I'm on a shared server that does support simple scripts, but something easy. Thanks.

Anonymous2010-01-18T13:32:48Z

Favorite Answer

Use a server-side script language if your web site allows it. Otherwise, you will have to use a client-side dependent "mailto:" action to get the form info sent to you.

Your current hosting package MUST allow SMTP ( http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol ) to work. Otherwise, no email can be sent.

Use any of the below sites to make the workable form you need:

For making forms:

These are really good online form makers. Just follow the instructions for making it and uploading file(s).

http://www.phpform.org/
http://www.tele-pro.co.uk/scripts/contact_form/
http://www.jotform.com/?gclid=CNKhqei1wJ4CFRQhnAod6laUqA (WYSIWYG Form Maker)
http://www.thesitewizard.com/wizards/feedbackform.shtml
http://www.thepcmanwebsite.com/form_mail.shtml

http://emailmeform.com/
http://www.freecontactform.com/
http://www.reconn.us/content/view/12/34/ (Download - Contact Us Script)
http://formsmarts.com/

just "JR"2010-01-18T02:47:44Z

Go to http://www.web2coders.com and download "form to email". It is a Php script.
You can try it before you download.
Since you already have the form, just adapt the script to your form.

LoRD ARaSSeN2010-01-18T02:53:10Z

a simple form that will take the input of the user of the form n send it to an email that u put.
hope this helps. btw its a working code i send u. tested n proven. ;)
u shud save this page as Contact_us.php

<?php

if(isset($_POST['submit']))
{
$canotsave=0;

//-----------------------------------------Validating Comment
//checking for empty fields
if($_POST["strComment"] == NULL)
{
$canotsave=1;
$error='Comment Box Cannot be left blank.';
}
if($_POST["strComment"] == 'We value your comments.')
{
$canotsave=1;
$error='Please verify your comment.';
}
//-----------------------------------------Validating Email
function validate_email($strEmail)
{ if (ereg("^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@([_a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]{2,200}\.[a-zA-Z]{2,6}$", $strEmail ) )
{ return true;}
else
{ return false;}
}
//checking for valid emails
if (!validate_email($strEmail))
{
$canotsave=1;
$error='Invalid Email.';
}
//checking for empty fields
if($_POST["strEmail"] == NULL)
{
$canotsave=1;
$error='E-mail required.';
}
if($canotsave==0)
{//if validation is sucessful
$strComment.="<br>Yours ".$strName;
$email = "YOUREMAIL@SOMETHING.COM";
mail($email, $strSubject, $strComment, "From: $strEmail");
}
}

?>




<body>

<div id="wrap">

<?php include 'include/menu.php';?>

<br/><br/>

<form action="Contact_us.php" method="post">

<table width="60%" align="center">
<tr>
<td colspan="2"><h2>Contact us</h2>
<?php
if(isset($canotsave))
{
if(!$canotsave==0)
{
echo "<font color='#FF3300'>$error</font>";
}
}
?>
</td>
</tr>
<tr>
<td>Name</td>
<td><input type="text" name="strName" size="26" /></td>
</tr>
<tr>
<td>Subject</td>
<td><input type="text" name="strSubject" size="26" /></td>
</tr>
<tr>
<td>Email</td>
<td><input type="text" name="strEmail" size="26" /></td>
</tr>
<tr>
<td>Comment</td>
<td> <textarea rows="6" cols="20" name="strComment">We value your comments.</textarea></td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" name="submit" value="Send Comment" /></td>
</tr>
</table>
</form>
<br/><br/><br/>
</div>
</body>
</html>