Re: mac os x - not getting headers already sent error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The problem is more of my own output sticking around (echo $query) and the test server still going to the next page, despite the echoed text.

I'm not sure how to use output buffering to fix this..

Jon

On Mar 7, 2005, at 2:01 AM, Burhan Khalid wrote:

Jonathan Haddad wrote:
I do all my development on mac os x. sometimes, to debut a script, i output the query to the page. quite often the page sends headers to go to another page. When i do this, i comment out the header() function and read the results. When i'm done i remove the comment
Sometimes I've forgotten to take out the debugging output. Now, on my server here, the page redirects and loads fine. But in the live environment, it craps out and people are left staring at a blank page.

This means that on the live server, error_reporting is at such a level that the Warning that is generated by php -- the "Cannot modify header information output started at ...." line isn't displayed, and since there is output to the client, the header() call fails, which is why you are left with a white screen.


You can use output buffering to avoid such a problem; there is also the header_sent() function.

HTH

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


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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux