zhangy Posted December 15, 2008 Share Posted December 15, 2008 Hello, I have a human intelligence identifier script but I want it to generate random labels. Preferably numbers between 1 and 10 that add together to from what will be the answer that the user enters. <lable for="captcha>1+2=</lable> Can anyone help? Quote Link to comment Share on other sites More sharing options...
btherl Posted December 15, 2008 Share Posted December 15, 2008 rand(1,10) will give you a random number between 1 and 10. Quote Link to comment Share on other sites More sharing options...
zhangy Posted December 15, 2008 Author Share Posted December 15, 2008 Cool thanks Btherl. Does anyone know how to apply this; get the random numbers to add together to equal the captcha answer? Quote Link to comment Share on other sites More sharing options...
Yesideez Posted December 15, 2008 Share Posted December 15, 2008 If you want to use an image captcha, here's one I made... http://www.coderprofile.com/networks/source-codes/535/simple-but-highly-effective-captcha Quote Link to comment Share on other sites More sharing options...
zhangy Posted December 15, 2008 Author Share Posted December 15, 2008 Thanks Yesideez, however I still would like to know more about the method I originally posted about Quote Link to comment Share on other sites More sharing options...
burnside Posted December 15, 2008 Share Posted December 15, 2008 sumit like this? $number1 = rand(1,10); $number2 = rand(1,10); $answer = $number1 + $number2; echo "<form action=\"?mod=cat\" method=\"POST\" /> what is {$number1} + {$number2}? <input type=\"text\" name=\"asn\" id=\"asn\" /> <input type=\"submit\" value=\"submit\" /> "; if($_GET['mod'] == "cat" ) { $myanswer = (int)$_POST['asn']; if($myanswer == $answer ) { echo " Right "; } else { echo " Wrong "; } } That is the idea i would use but im not the best in the world. BUT since computers are designed to do math that would be easily cracked thus doing nothing. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted December 15, 2008 Share Posted December 15, 2008 Text based math questions are very easy for php to find in the source of the page and directly solve using one built in php function without any real programming skill required and should not be used. 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.