Page 1 of 1

global variable in PHP to store users input ???

Posted: Wed Sep 11, 2002 1:15 am
by blueriver
My problem is:
- I'd like to create a global variable (in PHP of course) to store the value of a submitted field so that (the global variable) is available to any other users from other clients acess to my site. Its something like "application variable" in ASP, but I wonder how to do it in PHP.

Anybody can help me out of this problem ?

Posted: Wed Sep 11, 2002 1:17 am
by Takuma
I think you need to store variable in a database or file.

Posted: Wed Sep 11, 2002 1:41 am
by blueriver
Thank Takuma. But I think in some cases the global variable is more convenient especially when the input data to store is simple, not so much & the next time to load the PHP site (I mean after all users close their browsers ) I dont want to recover the data of the previous load for users to use.

Posted: Wed Sep 11, 2002 1:52 am
by volka
There's another thread that covers emulationg ASP's application object

Posted: Wed Sep 11, 2002 5:38 am
by mikeq
Sounds like you need to define a Constant, or if it has to be a variable (someone can change the value later), just add it to an include file that will be called in each page.