Wierd question perhaps, but is there a wa that i can play with the order that code is executed as I have an include halfway down which i need to leave in place - but i also need it to update something in the header of the page, which currently does not work. I have tried moving said code below the include and it works fine - any ideas?
Code is executed from top to bottom. You may have to include somethign before it is being used. Or use some trick like changing the DIV content by dynamically generating the javascript. Its all about understanding the basics and applying the logic. Hard to give detailed suggestion, I am tempted to ask more questions rather! As a suggestion, you may spend some more time for planning.
hmm, thanks. though plannning still led to this problem - its not always possible to spot all problems on the horizon
I still try to follow the principles I learned coding C. All includes are at the top of the file. Any data needed by functions is explicitly passed to it and results from the function explicitly returned. Using this approach in PHP solves the problem of includes needing to be in multiple places to satisfy multiple needs. This also ensures data needed for each function is given to it in a way that lets the function manipulate the data without affecting other parts of the program -- ie, resetting the value to something unexpected!
you could do that using: ob_start(); echo header info; $holdit = ob_get_contents(); ob_end_clean(); echo second stuff echo $holdit; PHP: is this what you need? Peace,