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))
echo "<br /><p align=center>$bannedMessage</p><br />";
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!
- Simple PHP Function Code to Check IP Against “Stop Forum Spam” API
- Generic PHP Function Code to Query “Stop Forum Spam” API
- HTTP Status Code Drinking Game
- ASCII Art Generators
- How to delete ASP.NET temporary files from shared server
- I’m told the customer is always right?
- Hung, Stalled, Blank Page During WordPress Core, Plugins, Themes, etc. Upgrade
- Moving From No Control Panel Servers to a cPanel Server