global variable in PHP to store users input ???

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
blueriver
Forum Newbie
Posts: 8
Joined: Mon Jul 08, 2002 4:38 am

global variable in PHP to store users input ???

Post 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 ?
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

I think you need to store variable in a database or file.
blueriver
Forum Newbie
Posts: 8
Joined: Mon Jul 08, 2002 4:38 am

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

There's another thread that covers emulationg ASP's application object
User avatar
mikeq
Forum Regular
Posts: 512
Joined: Fri May 03, 2002 3:33 am
Location: Edinburgh, Scotland

Post 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.
Post Reply