FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » buffering to allow headers in code?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: buffering to allow headers in code? [message #170165 is a reply to message #170163] Thu, 14 October 2010 13:46 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 10/14/2010 9:39 AM, MikeB wrote:
> 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.

Actually, I read that wrong - sorry.

If your code is constructed properly, the header command will be sent
before any output - and no problem. If you buffer your output then send
the header command, the output won't get to the screen, anyway. So
there's no point.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Mesothelioma
Next Topic: Good code or bad code?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 11:01:08 GMT 2024

Total time taken to generate the page: 0.04179 seconds