I have a problem with the header in php.
I have this simple code.
<?php
header ('Content-Type: image/png');
$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);
imagepng($im);
imagedestroy($im);
?>
I think it should work fine, but it is not. There is no error, and a short image icon appears in the upper left corner of my browser.
I think the problem is with the header.
other useful information: PHP version 5.3.10-1ubuntu3.9 GD support GD version 2.0 FreeType support included FreeType Communication with freetype FreeType Version 2.4.8
UPDATE
In IE, even if I have a header, I got a bunch of data ...
source
share