Problem with Session and register_globals

From: Date: Sat, 26 Oct 2002 18:24:38 +0000
Subject: Problem with Session and register_globals
Groups: php.general 
Request: Send a blank email to php-general+get-121540@lists.php.net to get a copy of this message
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?

« previous php.general (#121540) next »