Welcome to the bloggy home of Noah Brier. I'm the co-founder of Percolate and general internet tinkerer. This site is about media, culture, technology, and randomness. It's been around since 2004 (I'm pretty sure). Feel free to get in touch. Get in touch.

You can subscribe to this site via RSS (the humanity!) or .

Contact Thanks


For the email.

Email address

Step 2:

Enter the email address below to send the form to:


$my_email = “nb@noahbrier.com”;


Enter the continue link to offer the user after the form is sent. If you do not change this, your visitor will be given a continue link to your homepage:

If you do change it, remove the “/” symbol below and replace with the name of the page to link to, eg: “mypage.htm” or “http://www.elsewhere.com/page.htm”


$continue = “http://www.noahbrier.com/contact-thanks.php”;


Step 3:

Save this file (FormToEmail.php) and upload it together with your webpage to your webspace. IMPORTANT – The file name is case sensitive! You must save it exactly as it is named above! Do not put this script in your cgi-bin directory (folder) it may not work from there.


You do not need to make any changes below this line.


// This line prevents values being entered in a URL

if ($_SERVER[‘REQUEST_METHOD’] != “POST”){exit;}

if($_POST[‘Spam’] != ‘eyeball’) {
echo ‘


You didn\’t pass the spam test.

If you\’re not a robot, I apologize, please hit the back button and try again. If you are a robot, get out of here and find someone else to spam . . . Please.


// Check referrer is from same site.

// if(!(isset($_SERVER[‘HTTP_REFERER’]) && !empty($_SERVER[‘HTTP_REFERER’]) && stristr($_SERVER[‘HTTP_REFERER’],$_SERVER[‘HTTP_HOST’]))){print “Please enable referrer logging to use this contact form. Your message was not sent.”; exit;}

// Describe function to check for new lines.

function new_line_check($a)

if(preg_match(‘`[\r\n]`’,$a)){header(“location: $_SERVER[HTTP_REFERER]”);exit;}



// Check for disallowed characters in the Name and Email fields.

$disallowed_name = array(‘:’,’;’,'”‘,’=’,'(‘,’)’,'{‘,’}’,’@’);

foreach($disallowed_name as $value)

if(stristr($_POST[‘Name’],$value)){header(“location: $_SERVER[HTTP_REFERER]”);exit;}



$disallowed_email = array(‘:’,’;’,”‘”,'”‘,’=’,'(‘,’)’,'{‘,’}’);

foreach($disallowed_email as $value)

if(stristr($_POST[‘Email’],$value)){header(“location: $_SERVER[HTTP_REFERER]”);exit;}


$message = “”;

// This line prevents a blank form being sent, and builds the message.

foreach($_POST as $key => $value){if(!(empty($value))){$set=1;}$message = $message . “$key: $value\n\n”;} if($set!==1){header(“location: $_SERVER[HTTP_REFERER]”);exit;}

$message = $message . “– \nThank you for using FormToEmail from http://FormToEmail.com”;
$message = stripslashes($message);

$subject = “Message from NoahBrier.com”;
$headers = “From: ” . $_POST[‘Email’] . “\n” . “Return-Path: ” . $_POST[‘Email’] . “\n” . “Reply-To: ” . $_POST[‘Email’] . “\n”;



May 8, 2010