markzzz
markzzz

Reputation: 47947

PHP - How can I do my own human verification?

I'd like to make my own php script for the human verification . Like an easy series of numbers/letters (captcha), nothing special.

Suggestion? Tips? Things to keep in mind?

Upvotes: 4

Views: 5774

Answers (4)

Steve Claridge
Steve Claridge

Reputation: 11080

I keep a list of questions and their associated answer server side. When generating the HTML for a form with a question I add the randomly selected question to the form and store the index of the question (from the list of questions) in the user's session. Then, when answer is posted I can simply check the answer with the index from the session.

Worth baring in mind that:

  • questions should be easy should be
  • unambiguous and have only one
  • possible answer user can enter answer in any case

Also worth having a "why are we asking this?" bit on the form as some users may be a bit confused as to why the question is there.

Upvotes: 2

Jon Skarpeteig
Jon Skarpeteig

Reputation: 4128

You can use the GD library to accomplish this. An example of how it can be done here: http://www.php-help.ro/php-tutorials/simple-php-gd-capcha-image/

Upvotes: 0

Joseph Le Brech
Joseph Le Brech

Reputation: 6653

You could use a captcha service such as recaptcha to check for a human.

Or create your own using an image library and storing the answers in a database and giving the names of the image file something that cannot be traced back to the word, you might need to make the words fuzzy as bot can use ocr.

another novel approach i saw was someone using an ascii art captcha like this

http://www.network-science.de/ascii/

Upvotes: 4

BigFatBaby
BigFatBaby

Reputation: 1510

this issue is widely covered by a simple google search.

you can use this tutorial example for a reference:

Upvotes: 3

Related Questions