Page 1 of 1

GD Library: Problem with header

Posted: Sat Dec 16, 2006 10:10 am
by GEORGEPAPA
Hi!

I have already installed gd2 library, but when i write the code:

header("Content-type: image/jpeg");
$im = @imagecreatefromjpeg('C:\RedFlowers.jpg'); /* Attempt to open */
touch($im);
imagejpeg($im);

the following warning is displayed:

Cannot modify header information - headers already sent by (output started at C:\wamp\www\mywebsite\ImageRetrieval\Browse.php:7) in C:\wamp\www\mywebsite\ImageRetrieval\Browse.php on line 159

Also, instead of an image many letters without meaning appear!

Do you know what I should do?

Posted: Sat Dec 16, 2006 10:15 am
by John Cartwright
This has been discussed hundreds of times, google for "Cannot modify header information - headers already sent"