imagejpeg() not sending output to the browser
Posted: Mon Mar 07, 2011 4:06 pm
Hi All,
I am trying to generate and send a Captcha directely to the Browser using imagejpeg() in a php script but it is not working. If I send the image to a file it works fine !
I am using the following script:
imagecreate();
......
header('Content-Type: image/jpeg');
imagejpeg($image);
<img src="captcha.php?width=100&height=40&characters=5"/> // I call the php script using <img/> tag from a html form...
As I mentioned before if I use all the code exactly as it is but I send the image to a file using: imagejpeg($image, file); It Works perfectly...
Any hint will be highly appreciated !
Thanks !
El Vasco
I am trying to generate and send a Captcha directely to the Browser using imagejpeg() in a php script but it is not working. If I send the image to a file it works fine !
I am using the following script:
imagecreate();
......
header('Content-Type: image/jpeg');
imagejpeg($image);
<img src="captcha.php?width=100&height=40&characters=5"/> // I call the php script using <img/> tag from a html form...
As I mentioned before if I use all the code exactly as it is but I send the image to a file using: imagejpeg($image, file); It Works perfectly...
Any hint will be highly appreciated !
Thanks !
El Vasco