Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jacobsantos
Forked from amkaos/gist:5357240
Last active December 16, 2015 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jacobsantos/5360124 to your computer and use it in GitHub Desktop.
Save jacobsantos/5360124 to your computer and use it in GitHub Desktop.
<!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
// 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();
}
// validation expected data exists
if(!isset($_POST['email'])) {
//$email_from = $_POST['email']; // required
//$message = $_POST['message']; // required
died('Missing email.');
}
if(!isset($_POST['message'])) {
//$email_from = $_POST['email']; // required
//$message = $_POST['message']; // required
died('Missing message.');
}
$name = $_POST['name'] ?: ''; // not required
$email_from = $_POST['email']; // required
$message = $_POST['message']; // required
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
$string_exp = '/^[A-Za-z .\'-]+$/'; // This appears to be unused within this scope.
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
if(strlen(trim($message)) < 2) {
$error_message .= 'Please enter Comments. Comments are required to be more than two characters in length.<br />';
}
if(strlen(trim($error_message)) > 0) {
died($error_message);
}
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 = "Form details below.\n\n";
$email_message .= "Name: ".clean_string($name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "message: ".clean_string($message)."\n";
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\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>
<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>&nbsp;</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>
</center>
<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 about the xxx
</center>
</p>
</div>
</div>
<div id="footer">
<p>Copyrights 2013 xxx &nbsp;|&nbsp; Web Design by xxx</p>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment