Peter Breuls's Weblog

 dinsdag 15 november 2005

Blog hacking stuff

Steve Rubel has a useful list of ways to hack your blog. David Krug has a contrarian list to balance things out.

[Scoble]

Nice stuff. Need to look into that.

IP blacklist checking

Here's how to check an IP address against standard DNS blacklist servers, for purposes of blocking comment spam and such:

function isBlacklisted($ip){
$check = join('.',array_reverse(explode('.',$ip))).'.xbl.spamhaus.org.';
return dns_check_record($check,'A');
}
?>

dns_check_record is checkdnsrr before PHP 5.


I've got some code somwhere on my harddrive at home that does something similar with njabl.org and Blitzed.org. It's ideal to use this in the user registration part of an online application or, ofcourse, in your everyday weblog comment system.

Maybe, if I can find it. I'll post it.