rofl90 Posted March 28, 2007 Share Posted March 28, 2007 Just started but how would i get it to 'create a random image' then 'validate it' Im COMPLETELY stuck ca anyone push me in the right direction/give me a link to a tutorial? Regards, Charlie. Quote Link to comment Share on other sites More sharing options...
ultrus Posted March 29, 2007 Share Posted March 29, 2007 Hello rofl90, Nucleus CMS (blog system) has a plugin called Captcha. It does the image verification. Looking at the plugin's inner workings may serve as a good reference: http://wakka.xiffy.nl/captcha Hope this helps! Quote Link to comment Share on other sites More sharing options...
Lytheum Posted March 29, 2007 Share Posted March 29, 2007 Basicly if you want to start from scratch you would need to generate a random string of letters/numbers, any length and case. Then, you would need to have a php-generated image display the random string (preferrably png). Then add the string to the session, maybe md5 it first. All that in one file (randimage.php). Then in your form, include 'randimage.php'; and a textbox next to it. When the form is submitted, you can validate it by: $sessval = $_SESSION['validate']; $validate = $_POST['validate']; $validate = md5($validate); if ($validate == $sessval) { echo "Validation successful!" }else{ echo "Validation failed."; } That's just basicly a rough sketch of how I would do it. Google some of the terms and it may get you somewhere. Otherwise you can use Captcha. Quote Link to comment Share on other sites More sharing options...
hitman6003 Posted March 29, 2007 Share Posted March 29, 2007 Use any of the classes found here: http://www.google.com/search?hl=en&q=php+Captcha&btnG=Google+Search or here: http://www.google.com/custom?domains=www.phpclasses.org&q=captcha&sa=Search&sitesearch=www.phpclasses.org&client=pub-2951707118576741&forid=1&channel=5742870948&ie=ISO-8859-1&oe=ISO-8859-1&cof=GALT%3A%23663399%3BGL%3A1%3BDIV%3A%23222222%3BVLC%3A663399%3BAH%3Acenter%3BBGC%3AA3C5CC%3BLBGC%3AA3C5CC%3BALC%3A0000FF%3BLC%3A0000FF%3BT%3A000000%3BGFNT%3A0000FF%3BGIMP%3A0000FF%3BLH%3A50%3BLW%3A256%3BL%3Ahttp%3A%2F%2Ffiles.phpclasses.org%2Fgraphics%2Fgooglesearch.jpg%3BS%3Ahttp%3A%2F%2Fwww.phpclasses.org%2Fsearch.html%3BFORID%3A1%3B&hl=en Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.