I am trying to use the imagecreate function to create a simple colored box. I think I have everything setup correctly, but I get two errors. The first one is a "Cannot add header info . . ." and the second one is the image stream is output in characters instead of an image, (e.g. ÿØÿàJFIFÿþ>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality ÿÛC $.' ",#(7),01444'9=82<.342ÿÛC 2!!).
I am using WinXP and PHP 4.2.3. I have gd and zlib installed and enabled. I think it is just a simple thing, but I can't figure it out. Will someone please help this newbie? Here is my code:
<?
Header("Content-Type: image/jpeg");
$im = ImageCreate(500, 75);
$red = ImageColorAllocate($im, 255, 0, 0);
ImageFill($im, 100, 100, $red);
ImageJPEG($im);
?>
Thanks,
Kory