GD Library: Problem with header

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
GEORGEPAPA
Forum Newbie
Posts: 1
Joined: Sat Dec 16, 2006 9:59 am

GD Library: Problem with header

Post 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?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

This has been discussed hundreds of times, google for "Cannot modify header information - headers already sent"
Post Reply