buffering to allow headers in code? [message #170163] |
Thu, 14 October 2010 13:39 |
MikeB
Messages: 65 Registered: September 2010
Karma:
|
Member |
|
|
I'm working through my class on PHP and I tried to put information from
my sign-on process in the navbar. This didn't work well, since I had to
reload the page to see it as the navbar was constructed earlier in the
code than the signon process. (Hard to explain, as we are building a
"dynamic" web page with lots of include files to fill in the main
content portion of the page.)
My instructor suggested that I do the reload of the page via php
header("Location: index.php");
after the sign-in. To do this, I have to turn on output buffering.
I recall struggling to turn off output buffering since someone here
recommended against it.
Any thoughts on this? Is this just a "quick and dirty" bypass for my
problem, accepted practice, a really bad idea, or customary practice?
I think I can code around this with some effort by putting a switch
statement in the header of the index.php, but that may be clumsy as
parts of the same web page will then be processed in two different areas.
What to do?
Thanks for any advice.
|
|
|