-
-
Save brianpeiris/5359550 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>Untitled Document</title> | |
</head> | |
<body> | |
<?php | |
if(isset($_POST['email'], $_POST['message'])) { | |
// EDIT THE 2 LINES BELOW AS REQUIRED | |
$email_to = 'xxx.com, '; | |
$email_subject = "xxx Questons"; | |
} | |
function died($error) { | |
// your error code can go here | |
echo "We are very sorry, but there were error(s) found with the form you submitted. "; | |
echo "These errors appear below.<br /><br />"; | |
echo $error."<br /><br />"; | |
echo "Please go back and fix these errors.<br /><br />"; | |
die(); | |
} | |
$name = ''; | |
if(isset($_POST['name'])) { | |
$name = $_POST['name']; // not required | |
} | |
$error = ''; | |
$errorFound = false; | |
function check_field($field_name) { | |
global $error, $errorFound; | |
$field_data = $_POST[$field_name]; | |
if(!isset($field_data) || $field_data == '') { | |
$error .= 'Please enter an ' . $field_name . '<br />'; | |
$errorFound = true; | |
} | |
} | |
check_field('email'); | |
check_field('message'); | |
if ($errorFound) { | |
died($error); | |
} | |
/*{ | |
$name = $_POST['name']; // not required | |
$email_from = $_POST['email']; // required | |
$message = $_POST['message']; // required | |
died($error_message); | |
}*/ | |
/*$name = $_POST['name']; // not required | |
$email_from = $_POST['email']; // required | |
$message = $_POST['message']; // required */ | |
$email = $_POST['email']; | |
$message = $_POST['message']; | |
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/'; | |
if(!preg_match($email_exp, $email)) { | |
$error .= 'The Email Address you entered does not appear to be valid.<br />'; | |
died($error); | |
} | |
$string_exp = "/^[A-Za-z .'-]+$/"; | |
if(strlen($message) < 2) { | |
$error .= 'The Comments you entered do not appear to be valid.<br />'; | |
} | |
/* if(strlen($error_message) > 0) { | |
died($error_message); | |
}*/ | |
$email_message = "Form details below.\n\n"; | |
function show_error($error_message){echo $error_message.""; | |
} | |
function clean_string($string) { | |
$bad = array("content-type","bcc:","to:","cc:","href"); | |
return str_replace($bad,"",$string); | |
} | |
$email_message .= "Name: ".clean_string($name)."\n"; | |
$email_message .= "Email: ".clean_string($email)."\n"; | |
$email_message .= "message: ".clean_string($message)."\n"; | |
// create email headers | |
$headers = 'From: '.$email."\r\n". | |
'Reply-To: '.$email."\r\n" . | |
'X-Mailer: PHP/' . phpversion(); | |
@mail($email_to, $email_subject, $email_message, $headers); | |
?> | |
<!--include your own success html here --> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<!-- | |
Commented out for debugging | |
<meta http-equiv="Refresh" content="10; URL=http://www.tap.kcorchidshow.org/contact.html"> | |
--> | |
<title>xxx xxcx xxx</title> | |
<meta http-equiv="Content-Language" content="en-us" /> | |
<meta http-equiv="imagetoolbar" content="no" /> | |
<meta name="MSSmartTagsPreventParsing" content="true" /> | |
<meta name="description" content="xxxsxxx xxx. " /> | |
<meta name="keywords" content="orchids, xxx, Orchid judging, xxx" /><style type="text/css" media="all">@import "../css/master.css";</style> | |
</head> | |
<body> | |
<div id="page-container"> | |
/*<div id="header"> <img src="../xximages/header.jpg.bak" alt="" width="900" height="243" /> | |
</div>*/ | |
<div id="main-nav"> | |
<ul id="navlist"> | |
<li id="active"><a href="index.html" >HOME</a></li> | |
<li><a href="req.html">REQUIREMENTS</a></li> | |
<li><a href="Links.html">LINKS</a></li> | |
<li><a href="feedback.html">TESTIMONIALS</a></li> | |
<li><a href="contact.html" id="current">CONTACT US</a></li> | |
</ul> | |
</div> | |
<p> </p> | |
<p><div id="textbox"><br><br> | |
<div id="content"> | |
<center><h1>Thank you for contacting us. <br /> | |
We will be in touch with you very soon.</h1> | |
<br><br> | |
Please wait 10 seconds and you will be transferred to the next page or <a href=http://www.tap.kcorchidshow.org/contact.html><font color="#0000ff">click here</font></a> to go now!</center> | |
<p><center>Please visit our website <a href="xxx"><i>www.</i></a> to learn more <br /> | |
about the xxx</center> | |
<p> </p> | |
</div> | |
</div> | |
<div id="footer"> | |
<p>Copyrights 2013 xxx | Web Design by xxx</p> | |
</div> | |
</body> | |
</html> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment