Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header already sent warning


MLu

Recommended Posts

Keep getting the "Header already sent" warning, but I simply cannot find the white-space culprit! Can anyone possibly tell where should I search?

 

The error I get is this, and I get it when I try to put a product in the shopping cart:

 

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\mysite\includes\configure.php:54) in C:\xampp\htdocs\mysite\includes\functions\general.php on line 60

 

- general.php line 60 has this code: header('Location: ' . $url);

- includes\configure.php only contains 30 lines (certainly not 54 lines as the error indicates)

- general.php, application_top.php, sessions.php, header.php, footer.php, index.php and whole lot more that I have checked do not have white space either before the opening PHP-tag or after.

 

Hope for some help - starting to get blind :blink:

Link to comment
Share on other sites

Think I would look at configure.php file first to see if there is anything missing on it (closing bracket or semi-colon etc.) to make the program think there is more than 30 lines

 

Incidentally how is your configure.php set up can you post the top half of it (exc. the database info)

My store is currently running Phoenix 1.0.3.0

I'm currently working on 1.0.7.2 and hope to get it live before 1.0.8.0 arrives (maybe 🙄 )

I used to have a list of add-ons here but I've found that with the ones that supporters of Phoenix get any other add-ons are not really neccessary

Link to comment
Share on other sites

Are you sure you're looking at the right configure.php? There are two of them (the other is in admin). Look them both over carefully, hitting the Delete key before the opening <?php and after the closing ?> just to be absolutely sure you're getting rid of any blanks, nulls, or other stuff. Both files should be just comments and define(); statements -- does yours have anything else?

 

Have you checked if something in configure.php is outputting an error message to the screen, that's hard to see (View > Page source to make it easier to see)?

Link to comment
Share on other sites

Think I would look at configure.php file first to see if there is anything missing on it (closing bracket or semi-colon etc.) to make the program think there is more than 30 lines

 

Incidentally how is your configure.php set up can you post the top half of it (exc. the database info)

Thank you VERY much! That indirectly gave the answer, but quite mysteriously I must say.

 

I have been transforming 4 old sites this week from MS2.2 to RC2.a, and I heavily rely on a file comparison program to easily see differences between two sites, and from that make some quick changes. Has so far worked brilliantly, but here something very odd happended. The configure.php file was shown in the file comparison program as being 30 lines, and with no leading/ending white spaces. But when I would copy the file to you using dreamweaver it suddenly turned out to be 60 lines and with two ending white spaces!! Removing these solved the problem :D Normally this program has consistently showed white spaces between lines and also those triggy ones before and after the opening/closing php tags.

 

Quite annoying though that the file comparison program (Above and Beyond version 2.5.3. seemingly gives misleading results). Also I getting a bit tired of this program because it shows entirely different files as being different until you manually open and close again. So a tip on a better file comparison program would be much appreciated!

Link to comment
Share on other sites

Dreamweaver is renowned for being pretty rubbish. ( in dev circles anyway, in design circles they seem to like it )

 

Get a decent PHP editor, a popular free choice is notepad++

Link to comment
Share on other sites

But when I would copy the file to you using dreamweaver it suddenly turned out to be 60 lines and with two ending white spaces!!

This is why my position is "never use Dreamweaver (or any other WYSIWYG page editor) for editing PHP script files". It can just do strange things to files. Some people say they've been editing for years with DW, so it's fine, but I still say you should use a plain text editor (ViM and Notepad++ come highly recommended) to view/edit files, and a plain FTP client to transfer files.

 

Quite annoying though that the file comparison program (Above and Beyond version 2.5.3. seemingly gives misleading results). Also I getting a bit tired of this program because it shows entirely different files as being different until you manually open and close again. So a tip on a better file comparison program would be much appreciated!

If you're on Windows, "fc" is built right in and does a pretty good job of showing differences. On a Linux box, "diff" does the same thing. If you're looking for color-coded inserts and deletes, while showing the entire files, I'm sure there's tools out there (but I don't use them).

Link to comment
Share on other sites

I never bother mentioning ViM here Phil as the average user just wouldn't use it.

Link to comment
Share on other sites

Dreamweaver is renowned for being pretty rubbish. ( in dev circles anyway, in design circles they seem to like it )

 

Get a decent PHP editor, a popular free choice is notepad++

I don't use Dreamweaver as a developing tool, but mostly as en editor similar to Notepad++. One of the problems with Notepad++ is that when you search for multi-line code, it finds it all-right, but only highlights the first line, so you cannot simply paste the replacement code over it. But otherwise I take your point :)

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...