Headers already sent ?
by nigel on 08-Sep-2010
Tonight I replaced the old photos web page with a new version.
Non technical persons should either skip or just grin and bear it through the next two paragraphs.
The original version used tables for laying out the page (the other pages on the site still do but they are targeted for renovation) which is not the modern way apparently, but now I am using <div> and the like. Behind the scenes instead of having a mixture of actual xhtml and procedural php it is all generated by php classes.
During the development and testing phase I checked the generated pages against Explorer, Firefox & Chrome and fiddled until they all looked and behaved the same way. This results in the full width picture slice link being done as a div block, an image and a bit of javascript coding because I could not get rid of a couple of spare lines of nothing underneath the image any other way.
So anyway it all work fine against your personal apache webserver (from wampserver) and so you upload it to the your host and bingo... your page is delivered with lots of warnings about how your "headers have already been sent" before you can get your cookies out. Great, all that effort and something completely new and unexpected pops up! And on the live site! My mother could be looking at it!
So after a rather a lot of forensic investigation we track it down to one php file that has a trailing space character on the last line. Instead of "?>" we have "?> " (look carefully).
Call that a header? That's not a header.
Non technical persons should either skip or just grin and bear it through the next two paragraphs.
The original version used tables for laying out the page (the other pages on the site still do but they are targeted for renovation) which is not the modern way apparently, but now I am using <div> and the like. Behind the scenes instead of having a mixture of actual xhtml and procedural php it is all generated by php classes.
During the development and testing phase I checked the generated pages against Explorer, Firefox & Chrome and fiddled until they all looked and behaved the same way. This results in the full width picture slice link being done as a div block, an image and a bit of javascript coding because I could not get rid of a couple of spare lines of nothing underneath the image any other way.
So anyway it all work fine against your personal apache webserver (from wampserver) and so you upload it to the your host and bingo... your page is delivered with lots of warnings about how your "headers have already been sent" before you can get your cookies out. Great, all that effort and something completely new and unexpected pops up! And on the live site! My mother could be looking at it!
So after a rather a lot of forensic investigation we track it down to one php file that has a trailing space character on the last line. Instead of "?>" we have "?> " (look carefully).
Call that a header? That's not a header.