note 26510 deleted from function.session-register by john

From: Date: Tue, 17 Dec 2002 09:25:41 +0000
Subject: note 26510 deleted from function.session-register by john
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-41003@lists.php.net to get a copy of this message
in contradiction to the above note that session_register() takes the current value of a variable and does not watch for changes, this code sample works as intuitivly expected: <?PHP session_start(); echo $_SESSION['i']; $i = 2; session_register('i'); $i = 3; echo '<a href="'.$PHP_SELF.'">click here</a>'; ?> this will result in $_SESSION['i] having the value of 3 after the first click. this is not true for this sample: <?PHP session_start(); echo $_SESSION['i']; $i = 2; $_SESSION['i'] = $i; $i = 3; echo '<a href="'.$PHP_SELF.'">click here</a>'; ?> this will result in $_SESSION['i'] having the value 2 after the first click, but having the value of 3 after the second click... at least this is true for php4.2.3 on apache/win32 greetings

« previous php.notes (#41003) next »