RE: [PHP] IMAGE CREATE() header problem
| From: | John Holmes | Date: | Sat, 25 May 2002 00:43:52 +0000 |
| Subject: | RE: [PHP] IMAGE CREATE() header problem | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-99191@lists.php.net to get a copy of this message | ||
Something is being output in index.php on Line 10. That's causing the
headers to fail. Check for whitespace.
---John Holmes...
> -----Original Message-----
> From: Dani [mailto:universal2001@iprimus.com.au]
> Sent: Friday, May 24, 2002 11:27 PM
> To: php-general@lists.php.net
> Subject: [PHP] IMAGE CREATE() header problem
> Importance: High
>
> Hi again,
>
> I have got this script :
> <?PHP
> //setup image
> $height = 200;
> $width = 200;
>
> $im = ImageCreate($width,$height);
> $white = ImageColorAllocate($im, 255, 255, 255);
> $black = ImageColorAllocate($im, 0, 0, 0);
>
> //Draw on image
> ImageFill($im, 0, 0, $black);
> ImageLine($im, 0, 0, $width, $height, $white);
> ImageString($im, 4, 50, 150, "Sales", $white);
>
> //output image
> Header ("Content-type: image/png");
> ImagePng ($im);
>
> //Clean up
> ImageDestroy($im);
>
> ?>
>
> but when I execute the script I got this ERROR MESSAGE:
> Cannot add header information - headers already sent by (output
started
> at D:\graphic_practise\index.php:10) in D:\graphic_practise\index.php
on
> line 25
>
> Any advise?
>
> thanks!
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php