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
https://forums.phpfreaks.com/topic/207819-to-prevent-robots/
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
https://forums.phpfreaks.com/topic/207819-to-prevent-robots/#findComment-1086362
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.