I have a guestbook based on the "usercomments" snippet, which three people use. Unfortunately one of those three is a spambot who posts at least three times a day a link to, well you don’t want to know.
So yesterday I was doing the regular cleanout and when I had finished there was new spam. In short I now have it’s IP address.
So is there an easy way to ban an IP from posting in the guestbook?
*waits for the "you should upgrade to..." comment* ( also appreciated )
You probably should upgrade to Jot. As should I. My personal website is so old that I’m constantly amazed it still works...
So if you’re like me and you’re just looking for a patch to get you through to that mythical time when you’ll have plenty of time to upgrade everything and do a complete redesign, here’s a useful line of code to add to your snippet:
if($_SERVER['REMOTE_ADDR']=='127.0.0.1') die('You\'ve darkened my door for the last time, you lousy spambot!');
It’s a bit drastic, but it will do the trick. You could just add the if statement to the posting part of your form processing if you don’t want to shut everything down. Replace 127.0.0.1 with the bad guy’s IP, of course.
Excellent Zap, I added that word for word, and will be updating to Jot as soon as I’ve, er, updated to 0.9.5
"You’ve darkened my door for the last time, you lousy spambot!"
*chuckles*