Hi -- I've been breaking my head trying to display images with a content header on 3 browsers (firefox, opera, netscape). For example, the code below is straight out of the PHP manual but all I get (in Opera) is a text with the term image inside a small space; firefox informs that the page won't display because of an error , but it doesn't specify what (even though display errors works fine). I tried Firefox Live HTTP headers and noted that the image exists, etc. but the GET image is being skipped. I checked to see if the headers were being sent by writing a redirection header to be executed if the headers for the image had NOT been sent, and I was redirected successfully. I can display images with echo, but not with a content header. What is wrong? Something in the php.ini file? Please help.
<?php
header("Content-type: image/png"
![winking smiley winking smiley](./mods/smileys/images/smilie3.gif)
;
$im = @imagecreate(110, 20)
or die("Cannot Initialize new GD image stream"
![winking smiley winking smiley](./mods/smileys/images/smilie3.gif)
;
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
Code copied from [
www.php.net]
but similar code won't work either.