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

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: 5.0/5 (1 vote cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)
PHP Code Block Vent In Spite of Spammers, 5.0 out of 5 based on 1 rating
Tags: , , , .

What are your thoughts?