


I unfortunately receive spam attempts to all of my email form systems, be it this website, a clients site, or especially genpets.com
blocking via keywords is nice, but nowadays spammers simply use groups of non coherent words.
here's a useful way to implement a block, depending on what sort of site you run it might work great.
generally no one sends me links via legitimate email on my forms, sometimes one or two. but never 5-7!
so it seems to make sense to count how many links are in a body of text, and then block the email if there's more than, in my case 5.
here's is the code below.
//check for link spam
preg_match_all("/http/i",$Message,$matches);
$cnt = count($matches[0]);
if($cnt >=5){$errors[] = "Email Spam detected! Please do not try again, your IP has been logged.";
}
obviously switch the IF to what you need, but I use an error array and only send if the array is empty.
this is not an end all be all approcah, but it should cut down on the amount coming through, and if combined with IP logging and keywords should be close to 100% successful.
(126) Total entries in journal
// Finland 2003
"That was when I realized. I asked myself could some of what these people be talking about actually be dangerous? And the best thing I can do is stay close to them, track what they are interested in and either hack it or try to confuse the spaces in which they operate". - Rob Van Kranenburg