New to the Mac? Check out TUAW's Mac 101

Preventing comment spam with JavaScript

Anyone who runs a weblog is aware of the scourge of automated comment spam. One of the most effective solutions (specifically for Wordpress, but adaptable for anything) has been this technique that adds a random hidden field to the comment form, and won't accept a comment without that field.

Elliott Back has taken the technique one step further: spam stopgap extreme uses JavaScript to generate a time-dependent, visitor-specific MD5 hash when the user submits the form, and the PHP backend won't accept the comment without the correct hash. This means a client has to support JavaScript to post. This is bad news for users with JavaScript disabled, but even worse news for comment spammers, who now face the difficult proposition of adding JavaScript support to their spamming tools.

In other comment spam news, Harry Fuecks at Sitepoint's PHP Blog has an excellent summary of the comment spam problem and the potential solutions, including a CSS trick I haven't seen before.

RESOURCES

RSS NEWSFEEDS

Powered by Blogsmith

Other Weblogs Inc. Network blogs you might be interested in: