PHP Code Block Vent In Spite of Spammers

Some spammers have been been filling in contact us forms on a lot of my websites of late. Us Linux server administrators have better things to do than process this crap! In protest, I coded this completely pointless block of code to vent my frustration. I implemented it knowing fully it will never stop all spam, but if one more of those SEO spam bots submits to it, a little bit of me will cheer inside.

[php]$bannedPhrases = array(" seo ", "engine optimisation", "engine optimization", "increase traffic");
$bannedMessage = "Hello spammer, please kindly f*** off and die painfully!";

foreach ($bannedPhrases as $value)
{
if (strpos($name, $value) || strpos($email, $value) || strpos($message, $value))
{
include "header.php";
echo "<br /><p align=center>$bannedMessage</p><br />";
include "footer.php";
die(); // do not send message
}
}[/php]

Immature I know, but no harm done.

EDIT: After posting this I realised it was really pointless, more than I realised at first. So I set to finding a better solution and posted it a short time later. See my post called Generic PHP Function Code to Query “Stop Forum Spam” API. Good luck fellow sysadmin!

Similar Posts:

VN:F [1.9.22_1171]
Rating: 3.0/5 (2 votes cast)
VN:F [1.9.22_1171]
Rating: +2 (from 2 votes)
PHP Code Block Vent In Spite of Spammers, 3.0 out of 5 based on 2 ratings
Tags: , , , .

What are your thoughts?