header problem

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
BayPhilip
Forum Newbie
Posts: 1
Joined: Sun Mar 29, 2009 7:01 am

header problem

Post by BayPhilip »

Sorry for silly question but I really can't find solution anywhere.

I had a message from server "Cannot modify header information - headers already sent by". I searched using google and found out that I should remove my <head></head> tag and write my php code at the begging of file. I done it. So now my index.php don't have <head></head> and it begins with <?php header('Content-Type: text/html; charset=utf-8'); ?>, but I keep getting this message. Any help will be good. Thank you in advance.

Sorry for bad English.
tech603
Forum Commoner
Posts: 84
Joined: Thu Mar 19, 2009 12:27 am

Re: header problem

Post by tech603 »

The "headers already sent" error is usually caused by having white space before or after the opening and closing PHP tags (<?php . . . ?>).

This link also provides a lot more explanation on this subject.
http://www.geeklog.net/faqman/index.php?op=view&t=38

Hope that helps
Post Reply