MSV FM

dot.antimicrobial@66.96.161.157: ~ $
Path : /hermes/bosweb01/b1720/hilightlearning.ca/
File Upload :
Current < : /hermes/bosweb01/b1720/hilightlearning.ca/contact_submit.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" >
<head>
<title>hiLight Design: Flash development, web and graphic design by Mary-Lynne Snedden</title>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<style type="text/css" media="screen">
@import url(css/hilight.css);
</style>
<style type="text/css" media="print">
@import url(css/print.css);
</style>
<meta name="description" content="Web and graphic design by Mary-Lynne Snedden specializing in educaton and interactivity." />
<meta name="keywords" content="online media, interactive learning objects, online education, web design, freelance, Canada, Ontario, Kitchener, Waterloo, London, Toronto, designer, design, print design, web designer, book design, html, css, flash" />
<meta name="author" content="Mary-Lynne Snedden" />
<meta name="copyright" content="Mary-Lynne Snedden" />
<meta name="company" content="hiLight Design" />
</head>
<body>
<div id="page">
  <div id="container" >
    <div id="content">
      <div id="header">
        <h1 title="Home"><a href="index.html" title="Home"><span>hiLight Design</span></a></h1>
      </div>
      <div id="nav">
        <ul class="menu">
          <li class="home"><a  href="index.html" title="Home"><span>Home</span></a></li>
          <li class="about"><a href="about.html" title="about"><span>About</span></a></li>
          <li class="work"><a href="work.html" title="work"><span>Work</span></a></li>
          <li class="contact"><a class="active" href="contact.html" title="contact"><span>Contact</span></a></li>
        </ul>
      </div>
      <div id="main">
       <?php
if(isset($_POST['email'])) {
	
	// EDIT THE 2 LINES BELOW AS REQUIRED
	$email_to = "mary-lynne@hilightlearning.ca";
	$email_subject = "Contact hiLight Learning";
	
	
	function died($error) {
		// your error code can go here
		echo "We are very sorry, but there were error(s) found with the form your submitted. ";
		echo "These errors appear below.<br /><br />";
		echo $error."<br /><br />";
		echo "Please <a href='javascript:history.go(-1)'>go back</a> and fix these errors.<br /><br />";
		die();
	}
	
	// validation expected data exists
	if(!isset($_POST['first_name']) ||
		!isset($_POST['last_name']) ||
		!isset($_POST['email']) ||
		!isset($_POST['telephone']) ||
		!isset($_POST['interested']) ||
	
		!isset($_POST['comments'])) {
		died('We are sorry, but there appears to be a problem with the form your submitted.');		
	}
	
	$first_name = $_POST['first_name']; // required
	$last_name = $_POST['last_name']; // required
	$email_from = $_POST['email']; // required
	$telephone = $_POST['telephone']; // not required
	$interested = $_POST['interested']; // not required
	$comments = $_POST['comments']; // required
	$newsletter= $_POST["newsletter"];
	

	
	
	$error_message = "";
	$email_exp = "^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$";
  if(!eregi($email_exp,$email_from)) {
  	$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
  }
	$string_exp = "^[a-z .'-]+$";
  if(!eregi($string_exp,$first_name)) {
  	$error_message .= 'The First Name you entered does not appear to be valid.<br />';
  }
  if(!eregi($string_exp,$last_name)) {
  	$error_message .= 'The Last Name you entered does not appear to be valid.<br />';
  }
  
  if(strlen($error_message) > 0) {
  	died($error_message);
  }
	$email_message = "Form details below.\n\n";
	
	function clean_string($string) {
	  $bad = array("content-type","bcc:","to:","cc:","href");
	  return str_replace($bad,"",$string);
	}
	
	$email_message .= "First Name: ".clean_string($first_name)."\n";
	$email_message .= "Last Name: ".clean_string($last_name)."\n";
	$email_message .= "Email: ".clean_string($email_from)."\n";
	$email_message .= "Telephone: ".clean_string($telephone)."\n";
	$email_message .= "Interested: ".clean_string($interested)."\n";
	
foreach ($newsletter as $f) {
$email_message .= $f."\n";
}
	$email_message .= "Comments: ".clean_string($comments)."\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);  

//spammer stuff
// check if any of the SPAMBOT criteria are true

	if(preg_match("/bcc:|cc:|multipart|url|Content-Type:/i", implode($_POST))) {
		$spam=true;
	}
	if (preg_match_all("/<a|http:/i", implode($_POST), $out) > 3) {
		$spam=true;
	}
	if(!empty($_POST['emailagain'])){
		$spam = true;
	}

	// if e-mail is not formatted correctly, show error message
	if(!eregi("^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$", $_POST['email'])) {
			$error = true ;
	}

	if($_POST['formtime'] < time()-3600)  {
		$spam=true;
	} //end spammer stuff
?>

<!-- include your own success html here -->

<p>Thank you for contacting hiLight Learning. We will be in touch shortly.</p>

<?
}
?>

        <h3><span>hiLight</span></h3>
        <div id="space" style="height:440px">&nbsp;</div>
        <div id="footer">
          <div class="hr"></div>
          <p class="heading">inspire - excite - delight</p>
        </div>
        <div class="trans"></div>
      </div>
    </div>
  </div>
</div>
</div>
</body>
</html>