TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   General (http://www.talkphp.com/general/)
-   -   Captcha (http://www.talkphp.com/general/1698-captcha.html)

kevthedude 12-10-2007 07:36 PM

Captcha
 
Hey guys I was wondering how you guys use CAPTCHA... I mean... I know how to code a basic one but I was wondering about the content you put into the image. Meaning, I've started to get bots who can read the code so I've started to make the CAPTCHA codes basic math problems. Do you guys think that any other content in CAPTCHA is annoying or have you found better ways to preclude bots from reading them.


By the way, I keep track of CAPTCHA failures so I know if a bot is trying to guess it... Funny when I see it says "13+14" instead of 27.

CMellor 12-10-2007 08:43 PM

I have mine select from a range of 1 to 999 and then MD5 hash encrypt it and then cut it down to just a length of 6 instead of 32.

PHP Code:

$length = isset($_GET['chars']) ? $_GET['chars'] : 6;
    
    
// Let's generate a totally random string using md5
    
$hash md5(rand(0999)); 
    
// We don't need a 32 character long string so we trim it down to 5 
    
$code substr($hash15$length); 



All times are GMT. The time now is 01:34 PM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0