Hi! I am a newbie in here. I try to create a simple image using php gd (in a file called index.html in the public_html folder), but there is no image show up. I have a header in html code before and change it afterwards. Here is the code:
And here is the output:HTML Code:<html> <body> <?php $im=imagecreatetruecolor(120, 20) or die('Cannot Initialize new GD image stream'); $text_color=imagecolorallocate($im, 233, 14, 91); imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color); header("Content-type: image/png"); imagepng($im); imagedestroy($im); ?> </body> </html>
Warning: Cannot modify header information - headers already sent by (output started at /home/kimo/public_html/index.php:3) in /home/kimo/public_html/index.php on line 9
PNG IHDRx0nIDATXI Ei5pl{."YVm:H-38.B!Q |m`j^|3r: +Gr:_hZ*&_jil{65O% <_V iFKE?2hs:`GaFӁ9˧^=[/;mk 8mW&+ij%(s(~+EЄB!y"IENDB`
Could anyone let me know what I did wrong? Thank you!


LinkBack URL
About LinkBacks
Reply With Quote


