Most people don't need one of those fancy scripts that generates random images with crazy backgrounds. Just ask your users a simple question. Spell 1? ____ If someone happens to make a bot that accomodates to your blog, which is horridly unlikely, unless you have some smart enemies, just chance the question.
Adding this is really easy, and comes in two parts. Add this to your comment form.
Spell one:
Now just add this to your action="whatever.php" code from the same form.
if (!($strtoupper($_POST['human'])=="ONE")) { exit; }
This simply sets their post to uppercase so it doesn't matter what case they write it in, and checks if it is the string "ONE". If they get the answer wrong, it exits the script. Ignore really short comments
Who cares about comments that say "great" with no detail? I rather have comments that contribute something to the blog. To ignore short comments:
if (strlen($comment)<30){ exit; }
Not that you should change $comment to whatever your variable the program uses to hold the comment. Too long comments
You can limit posts length in the php.ini and you can just add this code.
if (strlen($comment)>2000){ exit; }
Blocking Links
if (ereg("HTTP://",strtoupper($comment))){ echo "No links please..."; exit; }
You can also use this code and change http:// to something like ASDF or IDIOT to block out jibberish and curse words. NoFollow
In your linking script, or if you link them directly withhtml, instead of a href= write a rel="nofollow" so that search engines don't follow the links in your blog and crawl more of your site. This is kind of controvercial, because it makes the browser not count them for pagerank, but it's best done with external comments by users.
¶ 11:45 AM