Buffering output to allow headers late in code?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 contnt 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.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux