Code: Select all
<?php
$safedomain = "http://www.mydomain.com";
$safedomain2 = "http://mydomain.com";
if ($_POST & ($_SERVER['HTTP_REFERER'] == "$safedomain/form.html" OR $_SERVER['HTTP_REFERER'] == "$safedomain2/form.html")){
$headers .= "From: $name <$email>\n";
$headers .= "Content-Type: text/plain; charset=iso-8859-1\n";
$tldn = "com";
$who = "username";
$where = "mydomain";
$recipient = $who.'@'.$where.'.'.$tldn;
$subject = "Customer Inquiry";
$message = wordwrap( $message, 1024 );
mail($recipient, $subject, stripslashes($message), $headers);
header("location: ../thanks.html");
}
else {
echo "An unknown error occurred.";
}
?>