Recently, I ran into a problem where I continually got a "Header already sent" message.
I took me a while to figure out because the file that was "included" only contained function definitions, or so I thought.
After the closing php tag, I had a new line with a single space on it. This space was, in turn, sent to the browser.


---- file.php begin (blah, not working) -----
<?php
function seomthing()
{ //do something
}
?>[enter]
[space]
---- file.php end ------

It wasn't until I removed the single space and any additional newlines that all worked fine.
Any non-null lines outside of the php tags will results in voiding all
rights to send any header or cache information, and this includes
space or newline characters.
Just an FYI.


---- file.php begin (cool, it works now) -----
<?php
function seomthing()
{ //do something
}
?>[no newline]
---- file.php end ------

Actually, you can have a newline after the clsoing php tab, but if you have a
non-null string following that (this includes newline characters), bad bad stuff can happen.





-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to