Powered by EZ FormMail. Get it free from http://www.sensationdesigns.com!
'; } function Check_Referer() { global $referers; $temp = explode('/', $_SERVER['HTTP_REFERER']); $referer = $temp[2]; $found = false; foreach ($referers as $domain) { if (stristr($referer, $domain)) { $found = true; } } return $found; } if ($_POST) { if (Check_Referer() == false) { echo 'Error: Invalid Referer
'; echo 'You are accessing this script from an unauthorized domain!'; Print_Footer(); die(); } $ctr = 0; $isrealname = 0; $isemail = 0; foreach ($_POST as $key => $val) { if ($key == 'realname') { $isrealname = 1; } if ($key == 'realemail') { $isrealemail = 1; } if (substr($key, 0, 4) == 'req_' || $key == 'realname' || $key == 'realemail') { if ($val == '') { if ($ctr == 0) { echo 'Error: Missing Field(s)
'; echo 'The following required field(s) were not filled out:
'; } echo '
- '.substr($key, 4).''; $ctr++; } } } if ($ctr > 0) { echo '

Click here to go back'; Print_Footer(); die(); } else { if ($isrealname == 0) { echo 'Error: Missing Field
'; echo 'No "realname" field found.

here to return to the home page.'; Print_Footer(); die(); } elseif ($isrealemail == 0) { echo 'Error: Missing Field
'; echo 'No "email" field found.

here to return to the home page.'; Print_Footer(); die(); } } if (!(preg_match("/^.{2,}?@.{2,}\./", $_POST['realemail']))) { echo 'Error: Invalid E-mail
'; echo 'The e-mail address you entered ('.$_POST['realemail'].') is invalid.'; Print_Footer(); die(); } $body = "Below is the result of your feedback form. It was submitted on:\n".date('l, F jS, Y').' at '.date('g:ia').".\n"; foreach ($_POST as $key => $val) { if ($key == 'recipient') { $recipient = $val; } elseif ($key == 'subject') { $subject = $val; } else { if ($key != 'realname' && $key != 'realemail') { $body .= "\n".str_replace('req_', '', $key).": $val"; } } } $body .= "\n\n-------- Submission Details --------\n"; $body .= "Remote Address: ".getenv('REMOTE_ADDR')."\n"; $body .= "HTTP User Agent: ".getenv('HTTP_USER_AGENT')."\n\n"; $body .= "--------------------------------------------------\n"; $body .= "Powered by EZ FormMail. Available at http://www.sensationdesigns.com!"; $mailheaders = "From: ".$_POST['realname']." <".$_POST['realemail'].">\n"; $mailheaders .= "Reply-To: ".$_POST['realemail']; mail($recipient, $subject, $body, $mailheaders); header("Location: $success_url"); } else { echo '

You have accessed this page from an invalid location. Please click here to go to '.$siteurl.'.
'; } Print_Footer(); ?>