email

Check for header injection attack and spam in your php form script

I wrote this to check for header injection attempts when processing a form that sends an email with php. (and I'll put it here so I can find it)

function is_spam( $message, $threshold = 1 ){
return _count_spam_body($message, $threshold) >= $threshold;
}

function _count_spam_body( $message, $threshold = 1 ){

$message = trim(strtolower($message));

//check the body of the message for spam or header injection attempts
$matches_bad = array(
"bcc:",
"cc:",
"to:",
"content-type:",
"mime-version:",
"multipart/mixed",




Hide your email from spiders - The easy way.

Many spiders look for the 'mailto' and @ characters in your links to farm email addresses.

Try this:
<a href="m&#97;ilto:myemail&#64;mydomian.com">Email me</a>

This uses special characters that substitute some characters in the link to fool the spiders!

Of course replace "myemail" and "mydomain.com" with your details.





Syndicate content