16/03/2010, 11:38
|
| | | Fecha de Ingreso: agosto-2009 Ubicación: Miranda
Mensajes: 188
Antigüedad: 15 años, 6 meses Puntos: 4 | |
Respuesta: crear captcha Cita:
Iniciado por zerpico_01 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(198, 48);
$bg = imagecolorallocate($im, 255, 255, 255);
imagefilledrectangle($im, 34, 2, 139, 199, $bg);
$fonts = "fonts/Blazed.ttf";
$izq = 98/2 - 42;
$t_color = imagecolorallocate($im, mt_rand(0,100), mt_rand(0,100), mt_rand(0,100));
imagettftext($im, 29, 1, $izq, 42, $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 |