unidox Posted July 22, 2008 Share Posted July 22, 2008 Just wondering if this is to simple? Can this easily be bypassed? How can I improve it? Thanks function captcha() { $rand = rand(1,15); $rand2 = rand(1,15); $math = array("+", "-"); if ($rand < $rand2) { $math = "+"; } else { $math = array_rand($math); } if ($math == "+") { $_SESSION['captcha'] = $rand + $rand2; return $rand . " " . $math . " " . $rand2; } else { $_SESSION['captcha'] = $rand - $rand2; return $rand . " " . $math . " " . $rand2; } } Link to comment https://forums.phpfreaks.com/topic/115951-captcha-secure/ Share on other sites More sharing options...
xtopolis Posted July 22, 2008 Share Posted July 22, 2008 The point behind CAPTCHA is that is asks something that a bot would not understand. It a simple state, it asks numbers/letters on an image and tells you to enter them. What you're doing is displaying numbers it seems. Those can be captured and read easily by an OCR, or any script that can read a string at a certain location. That is why they put the letters/numbers into images, so they can't be read as easily. So, technically, no. Ask yourself if your site is popular enough to get many bots. And possibly do something that says "Check the third box in order to continue" and have 3 check boxes, and make the "third" random. That would be harder for a bot to manipulate. and you could also make "third" change text to "box number 3" etc so they couldn't guess what you would ask as easily. Link to comment https://forums.phpfreaks.com/topic/115951-captcha-secure/#findComment-596172 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.