I've temporarily fixed the solution on my site by updating my guestbook script with these bits of code:
Code: Select all
if(checkForBullshit($frmName) || checkForBullshit($frmEMail) || checkForBullshit($frmComments))
{
// add this person's IP address to the banned IP list.
if($fd = fopen("spammerips.txt", "a"))
{
$textout = $_SERVER['REMOTE_ADDR'] . "\n";
fwrite($fd, $textout);
fclose($fd);
}
header("Location: http://www.dontadvertiseonmysiteyouscumsuckingpseudocorporatemorons.com/");
exit(0);
}
// ...
function checkForBullshit($in)
{
if( stristr($in, "poker") ||
stristr($in, "holdem") ||
stristr($in, "casino") ||
stristr($in, "andrewsaluk") ||
stristr($in, "gambling") ||
stristr($in, "gamble") ||
stristr($in, "p0ker")
)
return true;
return false;
}
If the script catches more people trying to spam it, then it's just a matter of adding the banned IPs to the .htaccess (I didn't want to let the script write directly to the .htaccess file for security).