Jump to content

To prevent robots


freelance84

Recommended Posts

I have no idea what these things are called but...

 

To prevent "robots" from filling out forms on your website successfully there is usually a graphical image of some letters and numbers.

 

Would i be right in guessing they work like this...

1. I create a series of these images

2. give each image a reference number (not the numbers/letters in the image)

3. create a mysql table with two fields, image reference & image contents

4. when a user comes to the form on my website an image is selected at random from all the possibles.

5. the user enters the letter/number combination and hits send. Php then simply checks the entered combination against the combination stored in the mysql table

 

As PHP can create images and letters, is there a script that can automatically generate any number of random combinations which eliminate the need for a special table in mysql?

Link to comment
Share on other sites

They're known as "CAPTCHA" (Completely Automated Public Turing test to tell Computers and Humans Apart) images, and no that's not how they're done.

 

The basic approach is to generate a sequence of numbers and/or letters, present them in a way that isn't easily readable by a computer (i.e. an image - which you can use the GD library to generate), and store the sequence within a session variable. Once the user enters the CAPTCHA sequence their entry is validated against the value in the session variable. If it's correct the form is processed, but if it's false a new CAPTCHA sequence is generated and they have to try again.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.