Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/10/2010, 09:28
adristb
 
Fecha de Ingreso: mayo-2010
Mensajes: 61
Antigüedad: 14 años
Puntos: 1
Fallo en el Captcha

Buenas llevo unos dias intentando resolver mi problema y no hay manera y esque realmente no entiendo lo que pasa porque este codigo ya lo utilice en otra pagina web, haber os explico

Tengo un formulario para poder dejar comentarios en una página donde el codigo es el siguiente:

<form id="formulario" name="formulario" method="post" action="visitas.php">
Su Nombre:
<br />
<input type="text" name="nombre" id="nombre" />
<br />
Su E-Mail (Si quiere):
<br />
<input type="text" name="email" id="email" />
<br>
Sus Comentarios:
<br />
<textarea name="comentarios" id="comentarios" rows="8" cols="40" ></textarea>
<br />
Ingresar el texto mostrado en la imagen <br>
<img src="php_captcha.php"><br>
<input name="tmptxt" type="text" size="30"><br>
<input name="action" type="hidden" value="checkdata">
<br />
<input type="hidden" value="seguir" name="oculto" id="oculto" />
<input type="submit" name="publicar" value="Publicar" onclick="validar(this.form)" />
</form>

Lo que he puesto en negrita es donde llamo a la pagina donde se encuentra el captcha y pone lo siguiente:

<?php
session_start();

$RandomStr = md5(microtime());// md5 to generate the random string

$ResultStr = substr($RandomStr,0,5);//trim 5 digit

$NewImage =imagecreatefromjpeg("img.jpg");//image create by existing image and as back ground

$LineColor = imagecolorallocate($NewImage,233,239,239);//line color
$TextColor = imagecolorallocate($NewImage, 255, 255, 255);//text color-white

imageline($NewImage,1,1,40,40,$LineColor);//create line 1 on image
imageline($NewImage,1,100,60,0,$LineColor);//create line 2 on image

imagestring($NewImage, 5, 20, 10, $ResultStr, $TextColor);// Draw a random string horizontally

$_SESSION['key'] = $ResultStr;// carry the data through session

header("Content-type: image/jpeg");// out out the image

imagejpeg($NewImage);//Output image to browser

?>

y aqué está el problema, parece que no llega a entrar en esta página ya que no me muestra ni la imagen de fondo ni los numeros y le he dado mil vueltas pero no encuentro el problema, los dos archivos están en el raíz y eso y esque no se que pasa,
alguien podria ayudarme??
Gracias de antemano