iwato 19 Posted June 9, 2017 Report Share Posted June 9, 2017 QUESTION: When a variable is passed via a super global from one file to another what happens to the variable that is passed? Where is it stored? What is its half-life? Roddy Quote Link to post Share on other sites
Ingolme 1,019 Posted June 9, 2017 Report Share Posted June 9, 2017 A super global is available during the execution of the process. What do you mean by passing it to another file? If the file is included, it has access to all the superglobals of the file that included it. Quote Link to post Share on other sites
iwato 19 Posted June 9, 2017 Author Report Share Posted June 9, 2017 Hi Ingolme, I was not clear. I want to know where the superglobal is stored? And, for how long I can use it and its contents after it has been sent. Based upon your response I should probably ask, if there is a way to pass a superglobal in such a way that it is permanently stored, and then accessible from any file with a get_file_contents( ) method. Roddy Quote Link to post Share on other sites
Ingolme 1,019 Posted June 9, 2017 Report Share Posted June 9, 2017 The superglobal is like any other variable in the PHP process, it only exists during the time the script is running. If you want to store its value permanently somewhere you can use a database or write it to a file. If you want to store something for one user during a browsing session you can use PHP sessions. 1 Quote Link to post Share on other sites
iwato 19 Posted June 9, 2017 Author Report Share Posted June 9, 2017 Quote If you want to store something for one user during a browsing session you can use PHP sessions. I am not there yet. Quote If you want to store its value permanently somewhere you can use a database or write it to a file. OK. This is what I needed to know. As ever, thank you, for your wonderful help. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.