Why doesn't image from PHP script appear in browser?

donovan

New member
I'm trying to show an image generated by a PHP script using
<img src="captcha.php" width="171" height = "70" />
but the image doesn't appear. A right click on Properties of the supposed image shows that the image is a .JPEG, but its size is 0 px by 0 px.

The PHP script captcha.php has last three lines of
header('Content-Type: image/jpeg');
imagejpeg($captcha);
imagedestroy($captcha);

Here's the part that really baffles me. When I used
imagejpeg($captcha, 'test.jpg')
I found that the image was being created perfectly, 171 x 70 px and perfectly readable! So why can't I see the doggone thing in the browser?
 
Back
Top