Re: [PHP] user-defined superglobals

2004-07-04 Thread Michael Gale
Hello, I am not a programmer so I do not know if you can create a superglobal variable. I am sure there is a problem with this ... any ways I user: require(db_access.php); at the top of all my pages that require db access for a application that way the db access gets set on a per page

Re: [PHP] user-defined superglobals

2004-07-04 Thread John W. Holmes
Michael Collins wrote: I am relatively new at PHP and wondering why there is no mechanism to create user-defined superglobals? For example in ASP.Net I can setup a global.asa to define database connections or any named value I want to be available anywhere in an application. It would be great

Re: [PHP] user-defined superglobals

2004-07-04 Thread Michael Collins
At 2:57 AM -0400 7/4/04, John W. Holmes wrote: Michael Collins wrote: I am relatively new at PHP and wondering why there is no mechanism to create user-defined superglobals? For example in ASP.Net I can setup a global.asa to define database connections or any named value I want to be available

Re: [PHP] user-defined superglobals

2004-07-04 Thread Jason Barnett
every script. For performance reasons it would be much better if certain values or code could be cached, as is the case with the ASP global.asa file. If the files and scope was limited to an application, or Web site, then a certain level of security should be possible. Well if you're looking

Re: [PHP] user-defined superglobals

2004-07-04 Thread Steve Douville
PROTECTED] Sent: Sunday, July 04, 2004 2:57 AM Subject: Re: [PHP] user-defined superglobals Michael Collins wrote: I am relatively new at PHP and wondering why there is no mechanism to create user-defined superglobals? For example in ASP.Net I can setup a global.asa to define database connections

Re: [PHP] user-defined superglobals?

2003-08-24 Thread Mike Migurski
It would be nice to have a php-function like declare_superglobal($_MYFRAMEWORK); And then use $_MYFRAMEWORK like $_GET. You have a few options: if you are looking to set variables that are static and atomic, you can use environmental variables in an .htaccess file (getenv() to access them) or

Re: [PHP] user-defined superglobals?

2003-08-23 Thread Ray Hunter
you can define your own superglobals by defining the vars first then accessing them thru the $GLOBALS var. example: ?php // file1.php $var1 = test1\n; $var2 = test2\n; ? ?php // file2.php include( 'file1.php' ); function test() { echo $GLOBALS['var1']; echo $GLOBALS['var2']; echo Test\n

Re: [PHP] user-defined superglobals?

2003-08-23 Thread Matthias Nothhaft
Hi Ray Hunter, you wrote: you can define your own superglobals by defining the vars first then accessing them thru the $GLOBALS var. example: ?php // file1.php $var1 = test1\n; $var2 = test2\n; ? ?php // file2.php include( 'file1.php' ); function test() { echo $GLOBALS['var1']; echo

Re: [PHP] user-defined superglobals?

2003-08-23 Thread Tom Rogers
Hi, Sunday, August 24, 2003, 3:45:33 AM, you wrote: MN Hi List, MN is there a way (mybe in php5?) to define/declare a global var as a MN superglobal, so that I can use this var like the known superglobals MN ($_GET, $_SESSION, etc.) ??? MN If not, is there a list for feature requests? MN

Re: [PHP] user-defined superglobals?

2003-08-23 Thread Matthias Nothhaft
Sorry this all is not what I'm looking for. I see it is not possible at the moment. It would be nice to have a php-function like declare_superglobal($_MYFRAMEWORK); And then use $_MYFRAMEWORK like $_GET. Thanks nevertheless. Regards, Matthias Ray Hunter wrote: Well, this is clear, (I'm only

Re: [PHP] user-defined superglobals?

2003-08-23 Thread Jim Lucas
: Saturday, August 23, 2003 11:44 AM Subject: Re: [PHP] user-defined superglobals? Sorry this all is not what I'm looking for. I see it is not possible at the moment. It would be nice to have a php-function like declare_superglobal($_MYFRAMEWORK); And then use $_MYFRAMEWORK like $_GET

Re: [PHP] user-defined superglobals?

2003-08-23 Thread Curt Zirzow
* Thus wrote Matthias Nothhaft ([EMAIL PROTECTED]): Hi List, is there a way (mybe in php5?) to define/declare a global var as a superglobal, so that I can use this var like the known superglobals ($_GET, $_SESSION, etc.) ??? If not, is there a list for feature requests? You can request

Re: [PHP] user-defined superglobals?

2003-08-23 Thread Jason Sheets
Someone wrote a php module that did this around 6 to 9 months ago. It was easy to install but you needed access to php.ini. Try using extract with the option to use references so you don't create a copy of the variable just a pointer to it. Jason Matthias Nothhaft wrote: Sorry this all is

Re: [PHP] user-defined superglobals?

2003-08-23 Thread Matthias Nothhaft
Hi Jason Sheets, you wrote: Someone wrote a php module that did this around 6 to 9 months ago. It was easy to install but you needed access to php.ini. Do you know where to get/download this module? Regards, Matthias Try using extract with the option to use references so you don't create a