11-14-2007, 03:42 PM
|
#5 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
This error is caused because of the way the HTTP protocol works. Fundamentally, it works like this:
User (Request Page) -> Server(Processes Request)
Server (Send Header Data) -> User (Interprets Header)
Server (Send Body Data) -> User (Parses Body)
So you can see that if you try sending header information after the body has been processed, then this would naturally result in an error, as you're seeing there. To get around this you should really be aiming for an order of execution like so:
Process PHP -> Process JS -> Process HTML -> Process CSS
Instead of how yours would currently be:
Process PHP -> Process JS -> Process HTML -> Process CSS -> Process PHP -> Process HTML
However, if you don't want to follow that elementary order of execution then you may wish to take a look into the ob_* functions - with a nice start being the ob_start function.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|