Captchas in PHP

I’ve been playing around with generating “captcha” images from PHP. Captchas are those Turing-test images used to screen out bots — the image contains text that a human is asked to type to demonstrate his/her humanity.

I generated these images using PHP5 and the gd image library which comes bundled with PHP. Two questions: 1) are they easy enough to read? 2) would they be hard enough to OCR?

I’d like to make a PHP-based captcha facility generally available, either as code or as a web service, in hopes that it would help in the fight against blog comment spam. (More about that when it’s ready.)

8 Responses to Captchas in PHP

  1. George Schlossnagle says:

    Definitely readable. They ‘look’ easier than some other captchas (e.g. Yahoo!’s reg captchas).

    Have you tried OCR’ing them with some of the free tools?

  2. John Wiseman says:

    I am a little concerned with the issues these present for disabled users. What do you think of the arguments and alternatives in , “Inaccessibility of Visually-Oriented Anti-Robot Tests”?

  3. Timboy says:

    Yeah, that had occurred to me as a worry, though I hadn’t seen this article.

    I quickly scanned the article, and although it’s obviously right about the problem, it doesn’t contain any very good alternatives for your everyday blogger. The relevant suggestions break down into 1) using other modalities, which can themselves be impaired (interestingly, they include cognitive impairments as an argument against logic puzzles), 2) very delayed feeback approaches (live operators), 3) possession of a credit card, and 4) being part of a much larger infrastructure, like MSFT single-signon. If anyone sees a good alternative approach that I’m missing, I’m interested.

  4. Timboy says:

    (In case you’re wondering, the reason the link in comment #2 is not clickable is that the designers of this blogware knew that allowing links in blog comments would encourage blog spammers. An ironic impediment to the dissemination of accessibility information, isn’t it?)

    Also, I have to be honest and say that I think that there is some inevitable tradeoff between accessibility and abuse, and the decision about how to trade those things off should be up to individual bloggers and webmasters.

  5. Pradeep says:

    Plz send captcha file

  6. Raven says:

    Where can we download the script?

  7. ken says:

    Very good – testing now

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: