How can i generate random numbers and make it as image to serve as a validation in the log in.
thanks.
How to generate turing number
Moderator: General Moderators
- chrys
- Forum Contributor
- Posts: 118
- Joined: Tue Oct 04, 2005 9:41 am
- Location: West Roxbury, MA (Boston)
The thing about posting directly to the browser is you have to send the proper image headers... then you can't display anything other than the image? Correct me if I'm wrong.feyd wrote:your script should not be storing the file, instead it should be returning it to the browser as if it were the image itself.
For future reference, they are called Captcha.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
you are absolutely correct. The form script needs to reference the Captcha script as an image. The Captcha script must return image headers and the image data as if it were an image, with nothing else in its stream. The Captcha's (if it's not predictable based on the inputs) answer and whatever information was used to create it should be stored in a database table and associated with the user in some fashion (session id comes to mind). Each page request should generate a completely new Captcha, destroying/replacing any existing Captchas that haven't been answered by that user...