aug 01 2005
comment spam
i have been getting comment spam, some of you might have noticed the poker, pills and texas poker spam in the comments...
the nerve! but i was a little prepared for it, even though i didn't have the time to do it when i noticed it on the w/end, but i did sort it out it this morning.
it's a 'manual' thing though, so i guess i should maybe investigate making it more dynamic? here is the code i insert at the top of my page and then add the ip's that i capture from the comments posted on the site. it's not full proof because they chop and change their ip addresses as easy i say 'piss off mo-fo's'...
<?phpi've been thinking of changing the echo, to just redirect to somewhere, but i've got to find something extremely nasty... ie. a page that just produces insane amounts of popups? anyone got any ideas?
// ban ip code
$banned_ip = array();
$banned_ip[] = '00.00.00.00'; // first IP
$banned_ip[] = '00.00.00.00'; // second IP
$banned_ip[] = '00.00.00.00'; // third IP, just add more if you need
foreach($banned_ip as $banned) {
$ip = $_SERVER['REMOTE_ADDR'];
if($ip == $banned) {
echo "You have been banned! It's probably because you spammed the comments or crawled for questionable content, if you think a mistake has been made contact someone@somewhere.com";
exit();
}
}
?>
Posted by sarah | web
comments
coda | 2005-08-12 18:32:00
sarah | 2005-08-12 18:04:52
sarah | 2005-08-12 17:59:13
coda | 2005-08-12 16:59:34
coda | 2005-08-12 13:19:39
sarah | 2005-08-12 12:30:51
sarah | 2005-08-04 21:01:40
coda | 2005-08-04 13:31:37
warrenski | 2005-08-03 15:43:20
warrenski | 2005-08-03 11:11:34
sarah | 2005-08-03 10:56:27
warrenski | 2005-08-03 09:46:53