I am now running PHP4 and understand that "Sessions" will keep the value of a global variable (or any variable?) from one webpage to the next. Is this true? I'm getting a lot of mis-information on this topic.

What I would like to do is play a background sound when the page loads. But I only want to do this once. I don't want the user hearing the same sound over and over if he chooses to reload the page for whatever reason.

Is there any way to do this with a global variable, or is a session required?

    A global variable is only global for the span of time that a program is actually running.
    A session can pass variables (which could also be passed via POST,GET,cookie (which sessions can use) or stored server-side in a DB or file).

      you could call a session variable a super-global..

        A global variable is only global for the span of time that a program is actually running. <<

        I don't understand. This is not a VB.exe on a local machine. This is a feature (I want to implement) in a PHP module that runs across webpages.

        Thanks for your input anyway.

          Would that then be similar to VB's "public" variable that spans modules?

          I don't see anything in the PHP literature that defines anything like a C++ extern.

            Write a Reply...