Hi --I'm testing Xampp after really struggling with Wamp trying to display images with a content header on 3 browsers (firefox, opera, netscape). However, I also have the problem with XAMPP, with the difference that I now get the following warning:
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\image_draw.php:1) in C:\xampp\htdocs\image_draw.php on line 2
PNG IHDRnV, PLTE [an
The warning also includes a bunch of question marks.
I'm using the the code below which is straight out of the PHP manual. 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. I'm using windows XP and given the warning I suspect something in windows is attempting to modify the header. Here's the code:
<?php
header("Content-type: image/png");
$im = @imagecreate(110, 20)
or die("Cannot Initialize new GD image stream");
$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 Example 1 at http://www.php.net/manual/en/function.imagecreate.php
...but similar code won't work either.
Thank you very much for ideas on how to correct this.