RE: [PHP] Cannot add header information - headers already sent
Hi ermelir, Thanks for your quick response! The http://www.aurelis.org/store/checkout_form.txt file shows in the browser with an empty first line: It may be an browser glitch. There's actually no space in the php file, i.e. it starts at line 1 with ?. I still receive the error. Any other thoughts? Thanks Fré -Original Message- From: ermelir [mailto:[EMAIL PROTECTED] Sent: dinsdag 12 augustus 2003 11:03 To: frederik feys Subject: Re: [PHP] Cannot add header information - headers already sent Hi, the problem is your empty first line: HTML header will be send if you call a function that send code to client browser (ex echo or print function) or if you have a empty line between php tags. for ex if you have - begin code ?php ... ? end code the empty first line is send to browser, so the HTML headers are send to; remove this line, you won't have errors any more - Original Message - From: frederik feys [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, August 12, 2003 10:59 AM Subject: [PHP] Cannot add header information - headers already sent Hi all, I'm stuck with this one: I have an checkout procedure: when people come to the overview page(step 2), they get: 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 header_aurelis.php is where actual html output starts (template) i had a similar problem in my cart. I solved this by adding at the top of my script: $cookie = GetCartId(); This doesn't do the trick now :-( For your convenience i put the code here: http://www.aurelis.org/store/checkout_form.txt and a handler file: http://www.aurelis.org/store/checkout_form_handler.txt Can anyone shed some light on this? Thanks! Fré -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot add header information - headers already sent
output started at /usr/local/www/vhosts/aurelis.org/htdocs/header_aurelis.php:95 says it all. Look into the file at line 95. frederik feys wrote: Hi all, Im stuck with this one: I have an checkout procedure: when people come to the overview page(step 2), they get: 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 header_aurelis.php is where actual html output starts (template) i had a similar problem in my cart. I solved this by adding at the top of my script: $cookie = GetCartId(); This doesnt do the trick now :-( For your convenience i put the code here: http://www.aurelis.org/store/checkout_form.txt and a handler file: http://www.aurelis.org/store/checkout_form_handler.txt Can anyone shed some light on this? Thanks! Fr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cannot add header information - headers already sent
Hi Marek, hi all, What do you mean by says it all? On that line the page title is outputted. I suspect something is wrong with the handler file: http://www.aurelis.org/store/checkout_form_handler.txt When i call http://www.aurelis.org/store/checkout_form.txt for step 1 (i.e. client personal register form) checkout_form gives no headers already sent. When the client proceeds to step 2 (i.e. an overview of purchase) the checkout_form_handler file is called. This does some calculations, etc.. and then redirects user to proper page using an header(location:) call. I suspect this step gives the header already sent. Any help appreciated! Fré -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: dinsdag 12 augustus 2003 12:15 To: frederik feys Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Cannot add header information - headers already sent output started at /usr/local/www/vhosts/aurelis.org/htdocs/header_aurelis.php:95 says it all. Look into the file at line 95. frederik feys wrote: Hi all, Im stuck with this one: I have an checkout procedure: when people come to the overview page(step 2), they get: 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 header_aurelis.php is where actual html output starts (template) i had a similar problem in my cart. I solved this by adding at the top of my script: $cookie = GetCartId(); This doesnt do the trick now :-( For your convenience i put the code here: http://www.aurelis.org/store/checkout_form.txt and a handler file: http://www.aurelis.org/store/checkout_form_handler.txt Can anyone shed some light on this? Thanks! Fré -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot add header information - headers already sent
To be more descriptive than Marek, some text (in this case the TITLE) has been sent to the browser around line 95 of header_aurelis.php. The reason you are getting this warning is because PHP is trying to send a header (redirect in this case) to the browser, but it cannot, because the output has already started. Clean up header_aurelis.php and make sure there's no browser output before the redirect. Yes, this means you might have to re-structure your script, or as a last result, you may consider using the OB (out buffering) functions. Justin On Wednesday, August 13, 2003, at 06:52 PM, frederik feys wrote: What do you mean by says it all? On that line the page title is outputted. I suspect something is wrong with the handler file: http://www.aurelis.org/store/checkout_form_handler.txt When i call http://www.aurelis.org/store/checkout_form.txt for step 1 (i.e. client personal register form) checkout_form gives no headers already sent. When the client proceeds to step 2 (i.e. an overview of purchase) the checkout_form_handler file is called. This does some calculations, etc.. and then redirects user to proper page using an header(location:) call. I suspect this step gives the header already sent. -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: dinsdag 12 augustus 2003 12:15 To: frederik feys Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Cannot add header information - headers already sent output started at /usr/local/www/vhosts/aurelis.org/htdocs/header_aurelis.php:95 says it all. Look into the file at line 95. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot add header information - headers already sent
You need to rethink your code logic. Any headers, be it cookies, cookies from session_start(), header() calls, must be send before any content, content is what you can see if you select view source and comes from echo, print, printf, errors and warnings, or anything that is outside of ?php ?. Or use output buffering. frederik feys wrote: Hi Marek, hi all, What do you mean by says it all? On that line the page title is outputted. I suspect something is wrong with the handler file: http://www.aurelis.org/store/checkout_form_handler.txt When i call http://www.aurelis.org/store/checkout_form.txt for step 1 (i.e. client personal register form) checkout_form gives no headers already sent. When the client proceeds to step 2 (i.e. an overview of purchase) the checkout_form_handler file is called. This does some calculations, etc.. and then redirects user to proper page using an header(location:) call. I suspect this step gives the header already sent. Any help appreciated! Fr -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: dinsdag 12 augustus 2003 12:15 To: frederik feys Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Cannot add header information - headers already sent output started at /usr/local/www/vhosts/aurelis.org/htdocs/header_aurelis.php:95 says it all. Look into the file at line 95. frederik feys wrote: Hi all, Im stuck with this one: I have an checkout procedure: when people come to the overview page(step 2), they get: 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 header_aurelis.php is where actual html output starts (template) i had a similar problem in my cart. I solved this by adding at the top of my script: $cookie = GetCartId(); This doesnt do the trick now :-( For your convenience i put the code here: http://www.aurelis.org/store/checkout_form.txt and a handler file: http://www.aurelis.org/store/checkout_form_handler.txt Can anyone shed some light on this? Thanks! Fr -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Cannot add header information - headers already sent by
Output has started at variables.php on line 321. Niklas -Original Message- From: Tom Nickels [mailto:[EMAIL PROTECTED]] Sent: 22. syyskuuta 2001 13:20 To: [EMAIL PROTECTED] Subject: [PHP] Cannot add header information - headers already sent by Hi everybody! I installed php 4.06 on Win NT, IIS 4. Before I updated php 4.00 with 4.06 my scripts were running fine. Since the update I am getting always the follwoing error: Warning: Cannot add header information - headers already sent by (output started at lang/dt/variables.php:321) in vote_submit.php on line 34 Line 34 is: header(Location: .$source.?status=9errormessage=$errormessage); Any idea, why this is after update not working anymore? Thanks for help Tom -- 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]
Re: [PHP] Cannot add header information - headers already sent by
So sprach »Tom Nickels« am 2001-09-22 um 12:01:23 +0200 : Warning: Cannot add header information - headers already sent by (output started at lang/dt/variables.php:321) in vote_submit.php on line 34 Line 34 of vote_submit.php is: header(Location: .$source.?status=9errormessage=$errormessage); Any idea, why this is after update not working anymore? Thanks for help Well, because in line 321 of variables.php, there's something printed. Alexander Skwar -- How to quote: http://learn.to/quote (german) http://quote.6x.to (english) Homepage: http://www.digitalprojects.com | http://www.iso-top.de iso-top.de - Die günstige Art an Linux Distributionen zu kommen Uptime: 2 days 22 hours 55 minutes -- 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]