Hola a todos!
Este es el código:
Código:
<?php
$pattern = "1234567890abcdefghijklmnopqrstuvwxyz";
for($i=0;$i<8;$i++) {
$key .= $pattern{rand(0,35)};
}
$captcha = imagecreatefromgif("../imagenes/captcha.gif");
$colText = imagecolorallocate($captcha, 0, 0, 0);
imagestring($captcha, 5, 16, 7, $key, $colText);
header("Content-type: image/gif");
imagegif($captcha);
?>
Ingresar el texto mostrado en la imagen <br>
<form action="" method="post">
<img src="../index/captcha.php" width="100" height="30"><br>
<input name="tmptxt" type="text"><br>
<input name="btget" type="submit" value="Verificar Codigo">
<input name="action" type="hidden" value="checkdata">
</form>
<?php
if ($_POST['action'] == "checkdata") {
if ($key == $_POST['tmptxt']) {
echo "Bienvenido";
} else {
echo "Inténtalo nuevamente";
}
exit;
}
?>
Cuando lo pruebo al navegador me dice lo siguiente:
No se puede mostrar la imagen “
http://www...php” porque contiene errores.
¿A qué puede deberse esto?
Gracias