Known spam bots are not allowed.");
}
foreach ($_POST as $key => $val) {
$c[$key] = clean($val);
if (preg_match($exploits, $val)) {
exit(" \n";
$headers .= "Reply-To: {$c['email1']}";
}
$recipient = "annwhitfield@btinternet.com";
if (mail($recipient,$subject,$message,$headers)) {
echo "
Exploits/malicious scripting attributes aren't allowed.
"); } elseif (preg_match($profanity, $val) || preg_match($spamwords, $val)) { exit("That kind of language is not allowed through our form.
"); } } $show_form = true; $error_msg = NULL; if (isset($c['submit'])) { if (empty($c['name']) || empty($c['comments'])) { $error_msg .= "Name and comments are required fields. \n"; } elseif ( empty($c['email1']) and empty($c['phone'])) { $error_msg .= "Email or Phone no are required fields. \n"; } elseif (strlen($c['name']) > 50) { $error_msg .= "The name field is limited at 50 characters. \n"; } elseif (!ereg("^[A-Za-z' -]*$", $c['name'])) { $error_msg .= "The name field must not contain special characters. \n"; } if ($c['email1'] <> '') if (!ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,6})$",strtolower($c['email1']))) { $error_msg .= "That is not a valid e-mail address. \n"; } if ($error_msg == NULL) { $show_form = false; if (!empty($c['url']) && !ereg("^(http|https)", $c['url'])) { $c['url'] = "http://" . $c['url']; } $subject = "St Ann's Booklet Order"; $message = "You received this e-mail message through your website: \n\n"; foreach ($c as $key => $val) { $message .= ucwords($key) . ": $val \n"; } $message .= "IP: {$_SERVER['REMOTE_ADDR']} \n"; $message .= "Browser: {$_SERVER['HTTP_USER_AGENT']}"; if (strstr($_SERVER['SERVER_SOFTWARE'], "Win")) { $headers = "From: Church Website \n"; $headers .= "Reply-To: {$c['email1']}"; } else { $headers = "From: Church WebsiteYour mail was successfully sent.
return to return to home page
"; } else { echo "Your mail could not be sent this time.
"; } } } if (!isset($c['submit']) || $show_form == true) { function get_data($var) { global $c; if (isset($c[$var])) { echo $c[$var]; } } if ($error_msg != NULL) { echo "ERROR:
";
echo nl2br($error_msg) . "
Please Note. The CD will not be available until mid-August