# How to avert SPAM bots # by Cyberian75 Updated: 04.01.05 (Added the line that automatically adds filtered comments to Park's b2blacklist) 27.11.04 (Modifications prior this date turned out to be useless) Source: http://cafelog.com/board/viewtopic.php?p=25578 This _EASY_ modification hinders external scripts to post/automated SPAM-scripts to spam your comments! SPAM bots are generally written so that it accesses your post script (i.e., "b2comments.post..php") directly with a bunch of common variables. One easy way to avert those bots is to simply rename the script flle frequently; however, it can get pretty troublesome as you'd also have change the value of form action attribute for your comments page(s). The only sure and easy way is to mandate users to comment ONLY from your comments page(s). To do this, you'd need to pass users' IPs alomg with their comments to the post script file and then do a comparison check... Put the following form input tag in your b2comments page(s): [code] [/code] Then in your "b2comments.post..php" file after the "$user_ip" variable near line 50: [code] $IP = $HTTP_POST_VARS["verify"]; if ($IP != md5($user_ip)) { exit("Your comment has been filtered as a SPAM!"); } [/code] Of course, this won't stop people from leaving SPAMs. For that, there's the Comments Blacklist hack. ADDITIONAL STEP Note: you need to have Michael Park's Comments Blacklist hack installed If you want it to automatically add the spammer to the blacklist, add the following: [code] mysql_query("INSERT INTO $tableblacklist (IP,name,URL) VALUES ('$REMOTE_ADDR','$author','$url')"); [/code] right before [code] exit("Your comment has been filtered as a SPAM!"); [/code]