random picture by js to be POSTed to php
The background of this thread is about CAPTCHA:
above is the js code I use to generate a random id, which in effect displays id.jpg on the web page (assume we have id.jpg in the right folder).
When a user sees that page, he is going to choose what word describes the picture best. (purpose of CAPTCHA: verify the user is a human)
The selection is sent to backend php script using POST method.
<option value="">Click to identify</option>
Here is my problem:
In the php script, I know, for example, the user chose Dog to describe the mysterious jpg generated by js code. But there's no way for me to know the id of the jpg file generated by js code. Hence, I will not be able to check whether the user chose a valid description of the jpg file.
How can I send information about the id of the jpg file to the php script?
Any idea is appreciated.
Basically, you need to also write that number out to a (hidden) form field, so that it gets submitted alongside the rest of the form.
One work of warning though - make sure that the OPTIONS in the SELECT are not in the same order as the images, and ideally have more than one image for each 'type', so that it really can't be worked out by a computer.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread