Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Fix error Headers already sent - general php


attom1

Recommended Posts

Posted

Hello,

 

Account history page in 2.3v has error:

Cannot modify header information - headers already sent by (output started at /home/patosira/public_html/includes/languages/english/account_edit.php:72) in /home/patosira/public_html/includes/functions/general.php on line 49

 

Code present on line 49:

 

header('Location: ' . $url);

 

Thank you kindly

Posted

The place to fix is includes/languages/english/account_edit.php, line 72. On my copy, that's the very last line of the file ?> and it's very likely you have some spaces (blanks) after the ?>. Remove those spaces or blanks.

 

Did you edit this file? If so, you or your editor added some crap after the closing ?>.

Posted

Thanks for your reply. Yes mine is blank space too. Haven't done any changes to account edit.

?> line 71

Line 72 (empty)

Will try

Posted

Had a quick go deleting empty line 70 and appears no change. Will have a fiddle around later when back working! Thanks

Posted

You want to delete every single character and line after the closing ?>. What comes before it doesn't matter. Usually blank lines after will cause a 500 error, but not always. Blanks or other characters on the same line (after ?> ) will definitely cause the "headers" error.

 

What's happening is that anything in a .php file not between <?php and ?> is considered straight HTML, and is sent directly to the browser as HTML. So, a blank after ?> will be sent as a piece of text to be displayed. When the first piece of text is sent to the browser, all "headers" are first flushed to the browser. If you've sent a piece of text too early, and then the program (PHP) tries to set more "headers", that will generate the error.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...