Hello, I generate an image with GD in the file generate_image.php
<?php // generate_image.php
require('config.php') require('functions.php'); require('secure.php');
header('Content-Type: image/png');
$im = imagecreate(15, 15);
// generation of the image // ...
imagepng($im); imagedestroy($im);
?>
But when I call this page in an image tag like this : <img src="generate_image.php" border="0">
The image is not found (I have the small red cross).
If I drop the 3 lines (require) at the beginning of the page then it works fine. The image is well displayed.
So I tought it was a problem with the headers, but I have verified, the 3 included files doesn't send any header.
That's very strange because if I have the 3 includes files in the code and then I go direct to the location of the file generate_file.php (and so I don't call it with a tag), then the image is well displayed.
Did you have an idea why the imaeg is not displayed when I call it with an img tag ?
Thanks a lot
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php