Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question on $GLOBALS

Status
Not open for further replies.

Bastien

Programmer
Joined
May 29, 2000
Messages
1,683
Location
CA
Hi All,

Quick q on $GLOBALS and it limitations.

Is this superglobal array analogous to the Application Level Variables in ASP?

The idea here is to set a group of system definitions (screen colors, custom label names etc) for a client on our website. I want the first user to access the site to assign those variables (all coming from a db) and let all subsequent users have access to those values as set by that first user.

Can the $GLOBALS array handle this? Or is there another, better way? I am simply trying to avoid the overhead of having to call it once for each user when creating the session...

Bastien

Cat, the other other white meat
 
If I understand ASP application-level variables, those are a set of values which are set once and made available to all the scripts of an application. A common dictionary of configuration values, as it were.

PHP does not have anything like that.

You can, however, simulate something like that. You can, for example, write a script which sets all the configuration values and have every script include that script.

The dictionary-creating PHP script can be run automatically for a directory or a site using auto_prepend_file.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Would that be less or more intensive than creating it as a session object?

Bastien

Cat, the other other white meat
 
A set of values in a session store can only be used by one user. I thought you wanted these values to be available to multiple users.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top