$errors=0;
if (isset($_POST['Submit']) && $_POST['Submit'] == "Submit") {
$number = $_POST['number'];
if(md5($number) != $_SESSION['image_value']) {
$error_message = "Validation string not valid! Please try again!";
}
else if(!(eregi("^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$",$_POST['email']))) {
$error_message = "The email address '".$_POST['email']."' does not seem to be valid.
Your message could not be sent. Please go back and try again.";
} else {
// BOF sanitize input
$_POST['email'] = preg_replace( "/\n/", " ", $_POST['email'] );
$_POST['name'] = preg_replace( "/\n/", " ", $_POST['name'] );
$_POST['email'] = preg_replace( "/\r/", " ", $_POST['email'] );
$_POST['name'] = preg_replace( "/\r/", " ", $_POST['name'] );
$_POST['email'] = str_replace("Content-Type:","",$_POST['email']);
$_POST['name'] = str_replace("Content-Type:","",$_POST['name']);
// EOF sanitize input
$email = $_POST['email'];
$name = $_POST['name'];
$message = $_POST['message'];
$today = date("M d, Y");
//////////////////////////////////////////////
// Insert your email address for recipient
$recipient = "networker@canadianchristianity.com";
/////////////////////////////////////////////
// Insert message you wish to show in subject of the email
$subject = "Website Contact Form";
$forminfo =
"Name: $name\n
Email: $email\n
Message:\n
$message\n\n
Form Submitted: $today\n\n";
$formsend = mail("$recipient", "$subject", "$forminfo", "From: $email\r\nReply-to:$email");
}
}
if(isset($_POST['Submit'])) {
if(!empty($error_message)) {
?>
Contact Form
Contact Form
Thankyou for your enquiry. You sent the following information.
echo nl2br($forminfo); ?>
Please fill out the form and click submit. All fields are required.