Fill-out this form as completely as possible and
someone will be in contact shortly.
Malicious code content detected.
Your IP Number of ".getenv("REMOTE_ADDR")." has been logged.";
/******** END OF CONFIG SECTION *******/
$company = $HTTP_POST_VARS['company'];
$title = $HTTP_POST_VARS['title'];
$fname = $HTTP_POST_VARS['fname'];
$lname = $HTTP_POST_VARS['lname'];
$phone = $HTTP_POST_VARS['phone'];
$ext = $HTTP_POST_VARS['ext'];
$email = $HTTP_POST_VARS['email'];
$comments = $HTTP_POST_VARS['comments'];
$headers = "From: $email\n";
$headers . "MIME-Version: 1.0\n"
. "Content-Transfer-Encoding: 7bit\n"
. "Content-type: text/html; charset = \"iso-8859-1\";\n\n";
if ($SpamCheck == "Y") {
// Check for Website URL's in the form input boxes as if we block website URLs from the form,
// then this will stop the spammers wastignt ime sending emails
if (preg_match("/http/i", "$company")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http/i", "$title")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http/i", "$fname")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http/i", "$lname")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http/i", "$phone")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http/i", "$ext")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http/i", "$email")) {echo "$SpamErrorMessage"; exit();}
if (preg_match("/http/i", "$comments")) {echo "$SpamErrorMessage"; exit();}
// Patterm match search to strip out the invalid charcaters, this prevents the mail injection spammer
$pattern = '/(;|\||`|>|<|&|^|"|'."\n|\r|'".'|{|}|[|]|\)|\()/i'; // build the pattern match string
$company = preg_replace($pattern, "", $company);
$email = preg_replace($pattern, "", $email);
// Check for the injected headers from the spammer attempt
// This will replace the injection attempt text with the string you have set in the above config section
$find = array("/bcc\:/i","/Content\-Type\:/i","/cc\:/i","/to\:/i");
$email = preg_replace($find, "$SpamReplaceText", $email);
$company = preg_replace($find, "$SpamReplaceText", $company);
$comments = preg_replace($find, "$SpamReplaceText", $comments);
// Check to see if the fields contain any content we want to ban
if(stristr($name, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();}
if(stristr($message, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();}
// Do a check on the send email and subject text
if(stristr($sendto, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();}
if(stristr($subject, $SpamReplaceText) !== FALSE) {echo "$SpamErrorMessage"; exit();}
}
// Build the email body text
$emailcontent = "
-----------------------------------------------------------------------------
WEBSITE CONTACT INQUIRY
-----------------------------------------------------------------------------
Company Name: $company
Title: $title
First Name: $fname
Last Name: $lname
Office Phone: $phone
Ext: $ext
Email: $email
What can we do for you?: $comments
______________________________________
End of Email
";
// Check the email address enmtered matches the standard email address format
if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}$", $email)) {
echo "
It appears you entered an invalid email address
Click here to go back.
";
}
elseif (!trim($company)) {
echo "
Please go back and enter your Company Name.
Click here to go back.
";
}
elseif (!trim($fname)) {
echo "
Please go back and enter your First Name.
Click here to go back.
";
}
elseif (!trim($lname)) {
echo "
Please go back and enter your Last Name.
Click here to go back.
";
}
elseif (!trim($email)) {
echo "
Please go back and enter your Email.
Click here to go back.
";
}
elseif (!trim($phone)) {
echo "
Please go back and enter your Office Phone number.
Click here to go back.
";
}
// Sends out the email or will output the error message
elseif (mail($sendto, $subject, $emailcontent, $headers)) {
echo "
Thank You $name
We will be in touch as soon as possible.
";
}
}
else {
?>