Ver Mensaje Individual
  #2 (permalink)  
Antiguo 16/03/2010, 00:08
Avatar de zerpico_01
zerpico_01
 
Fecha de Ingreso: enero-2008
Ubicación: Wilde - Avellaneda -
Mensajes: 421
Antigüedad: 16 años, 3 meses
Puntos: 13
Respuesta: crear captcha



http://www.forosdelweb.com/f18/captcha-php-704556/

usa el mas utilizado



http://www.phpcaptcha.org/

pero realmente es sencillo hacerlo

Código PHP:
function captcha(){
        
$md5 md5(microtime() * mktime());
        
$string substr($md5,0,5);
        
$_SESSION['key'] = $string;

        
header("Content-type: image/png");
        
$im imagecreatetruecolor(19848);
        
$bg imagecolorallocate($im255255255);
        
imagefilledrectangle($im342139199$bg);
        
$fonts "fonts/Blazed.ttf";
        
        
$izq 98/42;
        
$t_color imagecolorallocate($immt_rand(0,100), mt_rand(0,100), mt_rand(0,100));
        
imagettftext($im291$izq42$t_color$fonts$string);
        
imagepng($im);
    } 
solo debes cargar la fonts en la carpeta.... aun que la validacion es otro tema mejor usa secureimagen !

saludos!!

Última edición por zerpico_01; 16/03/2010 a las 00:14