Warning: Cannot modify header information - headers already sent by

Posted by bhaskaragr29 on Stack Overflow See other posts from Stack Overflow or by bhaskaragr29
Published on 2010-05-04T10:10:51Z Indexed on 2010/05/04 11:08 UTC
Read the original article Hit count: 310

Filed under:
|

When i try run this file i am getting this error.

<?php

$im = imagecreatetruecolor(100, 100);

// sets background to red
$red = imagecolorallocate($im, 255, 0, 0);
imagefill($im, 0, 0, $red);

header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp1\htdocs\check\2.php:1) in C:\xampp1\htdocs\check\2.php on line 7
?PNG  ??? IHDR???n??????V,????PLTE????[an????fIDAT?c`?`fx???`?????41???????q?@?;{á0? ?i 

© Stack Overflow or respective owner

Related posts about php5

Related posts about gd