Re: "super" global variable
| From: | Chris Lee | Date: | Tue, 15 May 2001 17:30:02 +0000 |
| Subject: | Re: "super" global variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-52914@lists.php.net to get a copy of this message | ||
this is something I never needed todo, but it works.
<?php
// www.miningsurplus.com/counter.php
session_id('0a99a548c57c06306e408cf44b2d5d10');
session_start();
if (!isset($HTTP_SESSION_VARS['counter']))
{
$counter = 0;
session_register('counter');
}
$counter++;
echo $counter;
?>
<?php
// www.mediawaveonline.com/counter.php
session_id('0a99a548c57c06306e408cf44b2d5d10');
session_start();
if (!isset($HTTP_SESSION_VARS['counter']))
{
$counter = 0;
session_register('counter');
}
$counter++;
echo $counter;
?>
these two files are on the same server, just under different domains. because I am using the same
session_id() they share the same value.
--
Chris Lee
lee@mediawaveonline.com
""Sigitas Paulavicius"" <sigitasp@m-1.lt> wrote in message news:9drd9l$jpp$1@toye.p.sourceforge.net...
Is it possible to declare some kind of "super" global variable in PHP, which
would be avaliable to all later PHP scripts/processes?
I suppose I could use a database or filesystem. But in this case of mine I
need to store and retrieve some values very fast and consuming as little
resourses as possible. These values would actually be used to determine if a
connection to database is required.
Any advice or comment would be really helpfull.
Sigitas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net