Ver Mensaje Individual
  #3 (permalink)  
Antiguo 16/03/2010, 11:38
Avatar de ricardoernes
ricardoernes
 
Fecha de Ingreso: agosto-2009
Ubicación: Miranda
Mensajes: 188
Antigüedad: 14 años, 8 meses
Puntos: 4
Respuesta: crear captcha

Cita:
Iniciado por zerpico_01 Ver Mensaje


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!!

si efectivamente... listo y muchas gracias, eso que estaa implementando era un poco complicado, gracias