Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Wez Furlong's Blog:
Blog Spam - a Solution
Jul 18, 2005 @ 11:09:05

For those dealing with comment spam, Wez Furlong might have a simple, quick answer to help.

Today, this blog got its first ever spam, via the trackback interface. How annoying. Here's how I've stopped it (yes, the regexes could be better, and the parse_url() call eliminated, but its late and this is a quick hack).

These two functions implement RBL and SURBL checks. RBLs, as you probably already know, are real-time block lists; you can look up an IP address in a block list using DNS, and if you get a record back, that address is in the block list. The first of the two functions implements this, in a bit of a lame hackish way.

It's a simple, but effective method, and has been implemented as a part of the Services_Trackback package already (along with several other helpful methods)...

tagged:

Link:


Trending Topics: