Problem with ImageCreate
Posted 03 April 2006 - 07:19 AM
<title> PHP TEST </title>
$im = imagecreate(600,115);
$backgroundColor = imagecolorallocate($im,204,204,153);
The problem is that it gives me warning :-
""Warning: Cannot modify header information - headers already sent by (output started at /home/compsci/jsharma/public_html/program3.php:6) in /home/compsci/jsharma/public_html/program3.php on line 8"
I know this problem is created because of white space character. But despite my sincere efforts I have not been able to locate any white spaces before or after <?php and ?> tags. Also instead of a GIF image I see some junk characters in the browser.
If i remove line containing header(); then the warning goes off but I still see junk characters in the browser and no image.
Please tell me if I am missing on something.
Thanks in advance
Posted 03 April 2006 - 11:36 PM
Posted 04 April 2006 - 04:48 AM
remove your <html> <head> and <body> tags, only have your php script in the web page, trust me I had the same problem and this cleared it up
Thank you so much for your help. This is the wierd problem that no one mentions in the text books or online tutorials. While rest of your code works with HTML tags, this doesnt.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users