Re: [PHP] Solution to "headers already sent" error.
Hy there 8) This one is easy... The thing IS that when you use the header statement there is absolutly NO OUTPUt like echo(); inside the PHP-brackets allowed AND NO OUTPUT allowed outside the PHP-Brackets, before the first header statement appears! Not even simple linebreaks or anything! So watch out for any linebreaks or tabs or spaces outside the php-brackets before the first header statment or any echo or print inside php-brackets before the first header-statement. regards, Jens on 19.06.2001 0:28 Uhr, Merio, Quinn at [EMAIL PROTECTED] wrote: > So, during the time the lists were down, i was banging my head over a > seemingly impossible error message. > > This was the error message: > > Warning: Cannot send session cache limiter - headers already sent > > What?! I exlaimed.. the first line in my page registered the session > variable i was using, so what was the deal. I turned out to be one measly > little space in front of my > If you are registering a session variable, it seems you cant have ANY > whitespace in the page before you register the session variable. > > Figured i would share that nugget, cus man did it ever drive me nuts, and i > saw no reference to it at all in the manuals. > > Quinn Merio > Vice President > Vir2lAlliance Inc. > www.vr2a.com >
Re: [PHP] Solution to "headers already sent" error.
(PHP4) In your php.ini file: output_buffering = On Now you can send header calls and session calls whenever you want. Also, take a look at: http://www.php.net/manual/en/ref.outcontrol.php Ethan - Original Message - From: "Alexander Wagner" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, June 18, 2001 3:54 PM Subject: Re: [PHP] Solution to "headers already sent" error. > Hiho, > > Merio, Quinn wrote: > > So, during the time the lists were down, i was banging my head over a > > seemingly impossible error message. > > > > Warning: Cannot send session cache limiter - headers already sent > > > > What?! I exlaimed.. the first line in my page registered the session > > variable i was using, so what was the deal. I turned out to be one measly > > little space in front of my > Well, reading the complete message should have helped, which goes like this: > > "Warning: Cannot add header information - headers already sent by (output > started at /foo/foo.php3:2) in /foo/bar.php3 on line 399" > > The message tells you in which file and on which line the output was started. > With PHP 4 it does, anyway. > > > Figured i would share that nugget, cus man did it ever drive me nuts, and i > > saw no reference to it at all in the manuals. > > Not in the session-section, no. But the description of the header()-function > (http://php.net/header) contains this paragraph: > > "Remember that the header() function must be called before any actual output > is sent, either by normal HTML tags blank lines in a file, or from PHP. It is > a very common error to read code with include(), or require(), functions, or > another file access function, and have spaces or empty lines that will output > before header() is called. The same problem exists when using a single > PHP/HTML file." > > Of course, this is hard to find when you're browsing through the > session-functions. A link might be useful. Something like "This function > needs to send a HTTP-Header, so you ... as with the header()-function." > > regards > Wagner > > -- > "Isn't it strange? The same people who laugh at gypsy fortune tellers take > economists seriously." > - Cincinnati Enquirer >
Re: [PHP] Solution to "headers already sent" error.
Hiho, Merio, Quinn wrote: > So, during the time the lists were down, i was banging my head over a > seemingly impossible error message. > > Warning: Cannot send session cache limiter - headers already sent > > What?! I exlaimed.. the first line in my page registered the session > variable i was using, so what was the deal. I turned out to be one measly > little space in front of my Figured i would share that nugget, cus man did it ever drive me nuts, and i > saw no reference to it at all in the manuals. Not in the session-section, no. But the description of the header()-function (http://php.net/header) contains this paragraph: "Remember that the header() function must be called before any actual output is sent, either by normal HTML tags blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that will output before header() is called. The same problem exists when using a single PHP/HTML file." Of course, this is hard to find when you're browsing through the session-functions. A link might be useful. Something like "This function needs to send a HTTP-Header, so you ... as with the header()-function." regards Wagner -- "Isn't it strange? The same people who laugh at gypsy fortune tellers take economists seriously." - Cincinnati Enquirer
[PHP] Solution to "headers already sent" error.
So, during the time the lists were down, i was banging my head over a seemingly impossible error message. This was the error message: Warning: Cannot send session cache limiter - headers already sent What?! I exlaimed.. the first line in my page registered the session variable i was using, so what was the deal. I turned out to be one measly little space in front of my