Page 1 of 1

How do i randomly display pictures

Posted: Sat Dec 05, 2009 11:33 am
by adsegzy
I want to use pictures as my CAPTCHA on my form page., i have all the pictures i want in my picture folder. is it possible or how do i display a different picture every time my form page is refreshed or visited?

If it is not possible, kindly recommend wayout.


regards

Re: How do i randomly display pictures

Posted: Sat Dec 05, 2009 11:36 am
by timWebUK
You don't want to do it through pictures, you want to create a background and randomly generate a string on top of it. This tutorial is quite good:

http://www.codewalkers.com/c/a/Miscella ... -with-PHP/

Re: How do i randomly display pictures

Posted: Sat Dec 05, 2009 12:05 pm
by askbapi
u can also use recaptcha, easy and fast.

Re: How do i randomly display pictures

Posted: Sat Dec 05, 2009 5:15 pm
by sangoku
timWebUK wrote:You don't want to do it through pictures, you want to create a background and randomly generate a string on top of it. This tutorial is quite good:

http://www.codewalkers.com/c/a/Miscella ... -with-PHP/
Why would you do that? then you could just let them pass.... :crazy:

the best way to do it if you want to do it old fashioned way is to make a table or hard write it into code mean the verification text and correlate it with the pictures them self. then when someone enters the seen text he you just have to clean his text and compare it with the referential one. That is fairly an easy way to do things, not to muhc code :drunk:

like make an :
array('image location' => text_of_the_image, .....);
then generate a random number put that in lets say $rand which gets a number which is in the range of the array. Then do something like this:

$link = $array[$rand]

//compare output the picture and store the text of the image in some value( :arrow: sesion? ) when the user tzpes it then just compare it XD pretty easy you could easy make aclass of it t0 XD