[PHP] Re: Cannot add header information - headers already sent
Frederik Feys wrote: Hi Frederik, Warning: Cannot add header information - headers already sent by (output started at /usr/local/www/vhosts/aurelis.org/htdocs/header_aurelis.php:95) in /usr/local/www/vhosts/aurelis.org/htdocs/store/includes/functions/get_ca rtID.php on line 14 Can anyone shed some light on this? You already have had the right answer, but I think you could consider adding this line at the top of your PHP script: ob_start( "ob_gzhandler" ); this enables HTML compression (on browsers that support it) and allows a much more flexible headers handling because text is sent back to the browser when your page is complete. Ciao, Fabio -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Cannot add header information
> Guys, Guys, why are you harrasing this poor chap? > > one sure simple way is.. > at the begining > ob_start(); > > > Starts output beffering.. and at the end, > > ob_end_flush(); > ?> > Throws out all the buffered output to the browser at the other end. > > now add header info any place before ob_end_flush(); and get no errors !!! Indeed... work around the problem instead of solving it... no need for fundamentals... ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Cannot add header information
Guys, Guys, why are you harrasing this poor chap? one sure simple way is.. at the begining Throws out all the buffered output to the browser at the other end. now add header info any place before ob_end_flush(); and get no errors !!! Lord Loh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Cannot add header information
G wrote: I have a script which adds header information to a different page, on my server I get a Cannot add header information - headers already sent by. But on other servers it works fine, does any1 know why?? below - yes its a space ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cannot add header information...
If you add ob_start(); at the start of your code, then you will be able to set Headers anywhere in your page. Peter > Per Waagen wrote: > > > Warning: Cannot add header information - headers already sent by (output > > started at /home/p/pe/perphp/public_html/login.php:4) in > > /home/p/pe/perphp/public_html/login.php on line 44 > -- > Avi Schwartz > [EMAIL PROTECTED] > > "I have to share the credit. I invented it, but Bill made it > famous." - IBM engineer Dave Bradley describing the > control-alt-delete reboot sequence -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: Cannot add header information...
Headers have to be sent before anything else is sent to the browser. Even once space appearing before the php openning tag will cause this error! Try to send the headers first thing in your code before any html code. Avi Per Waagen wrote: > Warning: Cannot add header information - headers already sent by (output > started at /home/p/pe/perphp/public_html/login.php:4) in > /home/p/pe/perphp/public_html/login.php on line 44 -- Avi Schwartz [EMAIL PROTECTED] "I have to share the credit. I invented it, but Bill made it famous." - IBM engineer Dave Bradley describing the control-alt-delete reboot sequence -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]