[PHP] super global variable

2001-05-15 Thread Sigitas Paulavicius

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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] super global variable

2001-05-15 Thread Alexander Wagner

Sigitas Paulavicius wrote:
 Is it possible to declare some kind of super global variable in
 PHP, which would be avaliable to all later PHP scripts/processes?

As long as you use one server only (no load-balancing), you can use 
shared memory.
http://php.net/shmop

Try phpbuilder.com or google to find a tutorial.

regards
Wagner

-- 
Some guy hit my fender, and I told him, 'Be fruitful and multiply,' 
but not in those words.
 - Woody Allen

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] super global variable

2001-05-15 Thread Chris Lee

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
 [EMAIL PROTECTED]



Sigitas Paulavicius [EMAIL PROTECTED] wrote in message 
9drd9l$jpp$[EMAIL PROTECTED]">news:9drd9l$jpp$[EMAIL PROTECTED]...
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]