paraclete Posted June 21, 2006 Share Posted June 21, 2006 When I registered for this forum I had to enter a 6 digit security number (often called a User Challenge). Many sites use this on email generating forms and it appears its often done in PHP. I want to create a form to be emailed to me and want a User Challenge code to prevent spam. How is the image of the code generated? How is the value of the code passed on for checking? Thanks for you help. Link to comment Share on other sites More sharing options...
aspnetguy Posted June 21, 2006 Share Posted June 21, 2006 You could create a number of diffent images and put them in a folder.Then create a database table to hold a image_id, image_text, and image_url.Then use php to generate a random number that you would use as the image_id. Then display the image_url and if what the user inputs is the same as image_text then they are done.Does that help? Link to comment Share on other sites More sharing options...
paraclete Posted June 21, 2006 Author Share Posted June 21, 2006 Yes - great. Thanks - I can work on that. I suppose I was hoping that since so many people seem to use these things there might be some ready-made source out there. Some of the systems seem to generate the graphic on the fly - or does it only seem like it? I have yet to find a site that repeats its code (when repeatedly refreshed) which sort of implies a directory somewhere with (potentially) hundreds of graphics in. Link to comment Share on other sites More sharing options...
aspnetguy Posted June 21, 2006 Share Posted June 21, 2006 I am sure it is possible to generate a random code and then create the graphic on the fly. I don't know how to do that in php and I am sure it would run slower if it did. My guess is that there are hundreds of images that they have Link to comment Share on other sites More sharing options...
justsomeguy Posted June 21, 2006 Share Posted June 21, 2006 There are plenty of algorithms to do that, different algorithms are better at producing images that humans can read but machines can't. The factors are things like different colors for letters, gradient backgrounds, letter deformation, different fonts for letters, different sizes, etc. Most people refer to these as "captchas". There is a huge list of implementations for various programming languages here:http://en.wikipedia.org/wiki/Captcha Link to comment Share on other sites More sharing options...
Little Goat Posted June 21, 2006 Share Posted June 21, 2006 ignore post. sorry. Link to comment Share on other sites More sharing options...
paraclete Posted June 22, 2006 Author Share Posted June 22, 2006 Great stuff JustSomeGuy, thank you Link to comment Share on other sites More sharing options...
justsomeguy Posted June 22, 2006 Share Posted June 22, 2006 No problem, let us know if you find one that works well for you. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now