session_start();
include $_SERVER['DOCUMENT_ROOT'] . "/inc/config.php";
$valid = array("Contact Worth Concrete" => "$email",);
$submitted = false;
if(isset($_POST['verificationcode'])) {
$submitted = true;
include($_SERVER['DOCUMENT_ROOT'] . "/inc/verification_image.class.php");
$image = new verification_image();
// do this when the form is submitted
if($image->validate_code($_POST['verificationcode'])&& $_POST['verificationcode'] != '') {
$to = $_POST['to'];
if(!in_array($to, $valid)) {
echo "Failure: Not a valid recipient.";
exit();
}
$subject = "Worth Concrete - Contact Form";
$thankurl = "/thankyou.html";
foreach($_POST as $key => $value) {
$message .= $key . ': ' . $value . "\n";
}
$headers = 'From: ' . $_POST['name'] . "<" . $_POST['email'] . ">" . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
header('Location: ' . $thankurl);
} else {
$message = "Verification failed:
";
$message .= "- You entered:" . $_POST['verificationcode'] . "
";
$message .= "- Correct code was:" . $_SESSION['verification_key'] . "
";
$message .= "";
}
}
?>
Worth Concrete
|
|
Contact Us & Estimates
Location:
2445 St Lukes Road
Salisbury, MD 21804
Mailing Address:
P.O. Box 278
Fruitland, MD 21826
Telephone: 410-546-5839
Fax: 410-546-0315
Officers:
President: Robert Lee Worth, III
Vice-President: Paul Wesley Worth Concrete
Secretary/Treasurer: Robert Lee Worth, Jr. |
|