[PHP] Problem with session and register_globals=off

2002-10-26 Thread Alexandre
Hello,

When I try the code below and register_globals=On, its work fine, the
counter variable is incremented each time that I load the page, but, when
register_globals=Off, its does not work, the counter variable is save just
in first time and never more.

?php session_start();
   // register a session variable
   session_register('counter');
   $counter = $HTTP_SESSION_VARS[counter];
   // increment and display the value of the counter
   $counter++;
   echo(You have visited this page $counter times! Don't you have
   anything else to do, you bum?!);
?

How can I fix this? With out to turn register_globals=On.

Thanks,



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Problem wih Session and register_globals

2002-10-26 Thread Jacques Marques
Hello,

When I try the code below and register_globals=On, its work fine, the
counter variable is incremented each time that I load the page, but, when
register_globals=Off, its does not work, the counter variable is save just
in first time and never more.

?php session_start();
   // register a session variable
   session_register('counter');
   $counter = $HTTP_SESSION_VARS[counter];
   // increment and display the value of the counter
   $counter++;
   echo(You have visited this page $counter times! Don't you have
   anything else to do, you bum?!);
?

How can I fix this? With out to turn register_globals=On.

Thanks,



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Problem with Session and register_globals

2002-10-26 Thread Jacques Marques
Hello,

When I try the code bellow with register_globals=On, it work was expected,
the counter variable is incremented each time that I load the page, but,
when I try with register_globals=Off, it doesn´t work, the counter variable
is incremented just in the first time, the session variable is not update.

?php session_start();
 // register a session variable
 session_register('counter');
 $counter = $HTTP_SESSION_VARS[counter];
 // increment and display the value of the counter
 $counter++;
 echo(You have visited this page $counter times! Don't you have
 anything else to do, you bum?!);
?

How can I fix this?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Problem with session and register_globals=off

2002-10-26 Thread John W. Holmes
$counter is not related to the session at all with register_globals OFF.
Use $HTTP_SESSION_VARS['count']++;

---John Holmes...

 -Original Message-
 From: Alexandre [mailto:alexandre;cmsmedical.com.br]
 Sent: Saturday, October 26, 2002 2:42 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Problem with session and register_globals=off
 
 Hello,
 
 When I try the code below and register_globals=On, its work fine, the
 counter variable is incremented each time that I load the page, but,
when
 register_globals=Off, its does not work, the counter variable is save
just
 in first time and never more.
 
 ?php session_start();
// register a session variable
session_register('counter');
$counter = $HTTP_SESSION_VARS[counter];
// increment and display the value of the counter
$counter++;
echo(You have visited this page $counter times! Don't you have
anything else to do, you bum?!);
 ?
 
 How can I fix this? With out to turn register_globals=On.
 
 Thanks,
 
 
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php