$mode = $_POST["mode"];
//print "This is the mode-->". $mode;
$messagestring = "";
if ($mode == "submit")
{
if ($_POST["name"] == "")
{
$messagestring .= "Please enter your name.
";
}
else if ($_POST["email"] == "")
{
$messagestring .= "Please enter your email.
";
}
else
{
$name = $_POST["name"]; //text input
$name = str_replace("\r\n", '',$name);
$address = $_POST["address"]; //text input
$address = str_replace("\r\n", '',$address);
$email = $_POST["email"]; //text input
$email = str_replace("\r\n", '',$email);
$city = $_POST["city"]; //textarea
$city = str_replace("\r\n", '',$city);
$state = $_POST["state"]; //textarea
$state = str_replace("\r\n", '',$state);
$zip = $_POST["zip"]; //textarea
$zip = str_replace("\r\n", '',$zip);
$phone = $_POST["phone"]; //textarea
$phone = str_replace("\r\n", '',$phone);
$comments = $_POST["comments"]; //textarea
$comments = str_replace("\r\n", '',$comments);
$message = "\n
Name: $name \n
Address: $address \n
City: $city \n
State: $state \n
Zip: $zip \n
Email: $email \n
Phone: $phone \n
Comments: $comments";
$subject = "Coho Design Contact Form";
$to = "khuber@cohodesignsllc.com";
$message = wordwrap($message, 70);
// To send HTML mail, the Content-type header must be set
$headers = "From:khuber@cohodesignsllc.com";
//$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $subject, $message, $headers);
$messagestring = "Thank you!!
";
$_POST["name"] = "";
$_POST["address"] = "";
$_POST["email"] = "";
$_POST["city"] = "";
$_POST["state"] = "";
$_POST["zip"] = "";
$_POST["phone"] = "";
$_POST["comments"] = "";
}
}
?>