MyBB Community Forums

Full Version: Cannot modify header error message
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I am receiving an error that says, in part, "Cannot modify header information - headers already sent by...". This takes place when I try to embed HTML code into the PHP to incorporate the look and feel of the rest of my site. I believe this is happening because the HTML tag is sending header information prior to the same thing being sent from the PHP code, and I am simply trying to determine a way around this. I don't know how else to do this without the HTML going first, as it is what defines the header graphics, navigation, etc., and the PHP code is in the main body, once again followed by HTML for the footer.

Any thoughts are appreciated...

Chuteme
Put the HTML in the header template and see what that does.

I might be wrong but I don't think you should put HTML in PHP files.
Correct. Never put HTML straight into any of the PHP files. Simply create templates in the Admin CP and call them, or add the HTML to existing templates.
(2008-08-15, 06:04 PM)LegosJedi Wrote: [ -> ]Correct. Never put HTML straight into any of the PHP files. Simply create templates in the Admin CP and call them, or add the HTML to existing templates.

Ooh I was right, wow Toungue Question, can you put PHP in the templates??
(2008-08-15, 07:57 PM)Matt_ Wrote: [ -> ]
(2008-08-15, 06:04 PM)LegosJedi Wrote: [ -> ]Correct. Never put HTML straight into any of the PHP files. Simply create templates in the Admin CP and call them, or add the HTML to existing templates.

Ooh I was right, wow Toungue Question, can you put PHP in the templates??

Not without ZiNgA's plugin that allows PHP and Conditional statements in templates.