Im completing an exercise in the book: php and mysql web developement - chapter 19.
This is the code:
<?
// set up 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);
?>
and I am getting the error:
Warning: Cannot add header information - headers already sent by (output started at c:\program files\apache group\apache\htdocs\simplegraph.php:2) in c:\program files\apache group\apache\htdocs\simplegraph.php on line 16
‰PNG IHDRÈÈ—–<ÝPLTEÿÿÿUÂÓ~õIDATxœuÓKrå @Q/µWÐIUßÀKÓR”èueÀ€ñ 6ºLÏ]UiY ¼EPÅPJDI(¥¬(‚¢(´ Z -…‚–BAK¡ MEQ hÚ‚6 M hÚEPÅÚÅÚÅÚÅÚÅÚÅ😃PÅ :Ä :Ä :Ä :Ä :Ä :EPÅ :Å :Å :Å :Å :Å ª"(ŠâUq‚ª8AUœ *NP'¨‰ (ÊÔdj25™ƒšÌAMæ KEQ¦ K¦ K¦ K¦ K¦ K¦ .‚¢(Ï .Ï .Ï .Ï .Ï .Ï AEQ % D”„’QA£Š¢J@‰( %£Üƒn"(Šb(%¢$”Œr º‹ (Š¡”ˆ’P2ÊôAQC (%¡d”!è)‚¢(†P"JBÉ(=hAQC (%¡d”+hAQC (%¡d”äˆ (Š¡”ˆ’P2J ªò.ß]d[‡ÛU»É;¾ßMÂ(ßö²µJåçg“{P›úßëëóÔþùxY?u”¿/³Kd,ýÿ§ÏvyÛ9ƒ\ (%¡d”#ÈAQC (%¡d”=DPÅPJDI(e "E1”€QJF)+Š (Š¡”ˆ’Pò/})R0ÂoªaIEND®B`‚
I have uncommented the extensions in the php.ini file is there anything else I need to do?
Thanks