Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/10/2011, 20:19
miguelcalla
(Desactivado)
 
Fecha de Ingreso: octubre-2011
Mensajes: 164
Antigüedad: 12 años, 6 meses
Puntos: 1
apoyo con codigo captcha

hola querida comunidad tengo el sgte codigo captcha el cual estoy tratando de incorporar a mi sistema de usuario, es de un post anterior: pero no me sale la imagen bgcaptcha.gif
algo estara mal chekeen porf. porque yo no veo el error.

seguridad.php
Código PHP:
<?php 
function randomText($length) {   //FUNCION PARA CREAR UNA CLAVE ALEATORIA
    
$pattern "123456789PIUYTREWQASDFGHJKLMNBVCXZ123456789PLMK1IJNBHUYGVC123456789FTRDXZSEWAQWSDERFTGYHUJ123569876543ERDFREDESWQASWQASDGHGTY"
    for(
$i=0;$i<$length;$i++) { 
      
$key .= $pattern{rand(0,35)}; 
    } 
    return 
$key


$_SESSION['tmptxt_seg'] = randomText(5); //aqui guardo el numero que se escribira en la imagen en variable de sesion para su us en la confirmacion
$captcha_seg imagecreatefromgif("http://lorelei.teleduc.cl/matricula_minrel/images/bgcaptcha.gif"); //obtenemos la imagen de fondo
$colText imagecolorallocate($captcha_seg000); 
imagestring($captcha_seg5104$_SESSION['tmptxt_seg'], $colText); 

header("Content-type: captcha/gif"); 
imagegif($captcha_seg); 
?>
index.php
Código HTML:
<html>
<head>cual es su mail</head>
<p></p>
<body>
	<form name="form_a" method="post" action="recuperar.php" />
			<p></p>
			<input type="text" name="email" id="email" size="60"/>
			<p></p>
			<input type="submit" name="submit" id="btn" value="Ir">
			<br>
			<img src="seguridad.php" vspace="3" class="Estilo24" /> <input type="text" name="tmptxt_seg" id="tmptxt_seg"  />
	</form>
</body>
</html>