Output Buffer

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • paladin.rithe@gmail.com

    #1

    Output Buffer

    My last question was about Sessions, and I'm still running into the
    same issue, but with a different class now (basicly it says that the
    class was not loaded), but I think I've narrowed it down to the way I'm
    using Sessions. My question now is about Output Buffers. I basicly
    made my own buffer and stored the information in a Session variable,
    and I think that is causing my problem.
    The reason I'm doing it this way, and not just a simple ob_start, etc,
    is that I want to be able to control the output. For instance, if I
    find that I want to add a menu item, but I'm at the end of my script,
    then I have a problem. But the way I was working it was that I would
    output everything at the end of the script. Plus, this gives me the
    advantage of being able to sort the menu the way I want, so I could
    output the one at the bottom of my menu (on a vertical one) first, and
    then one at the top if that's the way the script happened to run.
    What would be the best way to do this? Like I said, I was using a
    Session variable, but I think that is causing a number of my problems.
    Should I just go with a global variable? It's possible I need to
    rethink how I was working stuff, as currently it redirects to a
    game.php which does the output. I did this to help discourage hitting
    back (as that would be extremely undesirable). Is there a better way
    to handle that as well?

  • Jerry Stuckle

    #2
    Re: Output Buffer

    paladin.rithe@g mail.com wrote:
    My last question was about Sessions, and I'm still running into the
    same issue, but with a different class now (basicly it says that the
    class was not loaded), but I think I've narrowed it down to the way I'm
    using Sessions. My question now is about Output Buffers. I basicly
    made my own buffer and stored the information in a Session variable,
    and I think that is causing my problem.
    The reason I'm doing it this way, and not just a simple ob_start, etc,
    is that I want to be able to control the output. For instance, if I
    find that I want to add a menu item, but I'm at the end of my script,
    then I have a problem. But the way I was working it was that I would
    output everything at the end of the script. Plus, this gives me the
    advantage of being able to sort the menu the way I want, so I could
    output the one at the bottom of my menu (on a vertical one) first, and
    then one at the top if that's the way the script happened to run.
    What would be the best way to do this? Like I said, I was using a
    Session variable, but I think that is causing a number of my problems.
    Should I just go with a global variable? It's possible I need to
    rethink how I was working stuff, as currently it redirects to a
    game.php which does the output. I did this to help discourage hitting
    back (as that would be extremely undesirable). Is there a better way
    to handle that as well?
    >
    Rethink the way you're doing things. What you're doing is making your
    code much more complicated and it will be a maintenance nightmare.

    Look at how much time you've already spent trying to get it to work.
    And think about if you have this every time you need to make a change.

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • Pedro Graca

      #3
      Re: Output Buffer

      paladin.rithe@g mail.com wrote:
      It's possible I need to
      rethink how I was working stuff, as currently it redirects to a
      game.php which does the output. I did this to help discourage hitting
      back (as that would be extremely undesirable). Is there a better way
      to handle that as well?
      Maybe HTML / HTTP is not the best technology for your intents.

      Can't you do your thing as a downloadable application instead?

      --
      File not found: (R)esume, (R)etry, (R)erun, (R)eturn, (R)eboot

      Comment

      • Chung Leong

        #4
        Re: Output Buffer


        Pedro Graca wrote:
        paladin.rithe@g mail.com wrote:
        It's possible I need to
        rethink how I was working stuff, as currently it redirects to a
        game.php which does the output. I did this to help discourage hitting
        back (as that would be extremely undesirable). Is there a better way
        to handle that as well?
        >
        Maybe HTML / HTTP is not the best technology for your intents.
        >
        Can't you do your thing as a downloadable application instead?
        Or Flash?

        Comment

        Working...