|
//form data for simple contact us
// BEGIN FORM
?>
| Salt Water Workshop |
| 583 River Rd |
| Buxton, ME 04093 |
| Tel: 207-837-0236 |
| E-mail: saltwaterworkshop@gmail.com |
if(!$_POST['submit'])
{
$services=array();
?>
}
else {
$contact_name = $_POST['contact_name'];
$c_email = $_POST['c_email'];
$business_name = $_POST['business_name'];
$c_address1 = $_POST['c_address1'];
$c_address2 = $_POST['c_address2'];
$c_city = $_POST['c_city'];
$c_state = $_POST['c_state'];
$c_zip = $_POST['c_zip'];
$c_fax = $_POST['c_fax'];
$c_phone = $_POST['c_phone'];
$c_email = $_POST['c_email'];
$comments = $_POST['comments'];
$services = $_POST['services'];
// set up error list array
$errorList = array();
$count = 0;
// include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';
//$securimage = new Securimage();
// validate text input fields
// if ($securimage->check($_POST['code']) == false) { $errorList[$count] = " The security code you entered was incorrect."; $count++;}
if (!$contact_name) { $errorList[$count] = " Contact Name"; $count++;}
if (!$c_email) { $errorList[$count] = " Contact Email"; $count++;}
if (!(ereg("^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$", $c_email))){ $errorList[$count] = "Contact e-mail address does not appear to be valid"; $count++; }
// if none found...
if (sizeof($errorList) == 0){
while (list ($key,$val) = @each ($services)) {
$listing.= "$val,";
}
$listing=preg_replace('/,$/','',$listing);
$date=date("F d, Y");
$message="\n\n Contact Name: ". $contact_name.
"\n Business Name: ". $business_name .
"\n Contact Address: \n". $c_address1 .
"\n". $c_address2 .
"\n". $c_city .", ".$c_state." ".$c_zip.
"\n\n Contact Fax: ". $c_fax.
"\n Contact Phone: ". $c_phone.
"\n Contact E-Mail: ". $c_email.
"\n Other Information: ". $listing.
"\n Comments: ". $comments.
"\n\n Date Sent: ".$date.
"\n\n";
// REMOVE STUFF //
$message=ereg_replace('[*<>#%]+','',$message);
// SEND MAIL //
$subject = "Request for more information";
$sendto = "saltwaterworkshop@gmail.com";
//$sendto = "info@mainegraphics.com";
$header = "From: $c_email";
mail($sendto, $subject, $message, $header);
// REMOVE STUFF //
$name=ereg_replace('[*<>#%]+','',$name);
$phone=ereg_replace('[*<>#%]+','',$phone);
$email=ereg_replace('[*<>#%]+','',$email);
$comments=ereg_replace('[*<>#%]+','',$comments);
?>
Thank you for requesting information. We'll get back to you as soon as we can. If you have any questions, please feel free to call us
|
} else
{
?>
}
}
?>
|