Re: Re: Codigo de Captcha en PHP

From: Date: Tue, 15 Aug 2006 00:09:35 +0000
Subject: Re: Re: Codigo de Captcha en PHP
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-240677@lists.php.net to get a copy of this message
On Mon, August 14, 2006 3:32 am, Julio B. wrote: > Hay muchos y muy variados en Internet. En alguna ocasión he usado el > que > viene en sBlog. Es muy sencillo de implementar y para la mayoría de > los > casos suficiente para evitarnos problemas de spam. > > En código es: > > <?php > > $key = (array_key_exists('k', $_GET) && strlen($_GET['k']) == 4) ? > $_GET['k'] : strtolower(substr(md5(rand()), 0, 4)); > > $im = imagecreatetruecolor(40, 20); > > $bg = imagecolorallocate($im, 0, 0, 0); > $col_text = imagecolorallocate($im, 255, 255, 255); > > imagestring($im, 4, 4, 1, $key, $col_text); > > header('Content-type: image/png'); > imagepng($im); > imagedestroy($im); > > ?> I can't read Spanish and am probably not answering your question, but if you are passing in ?k=ABCD and the image just contains ABCD, then the Bad Guy only has to see the URL and figure out how to get ABCD to break your CAPTCHA... Here is a very crude minimalistic example CAPTCHA implementation that you may find useful: http://voodookings.net/eyesonly_example.htm -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#240677) next »