note 26517 deleted from function.session-register by john
| From: | john@php.net | Date: | Tue, 17 Dec 2002 09:26:07 +0000 |
| Subject: | note 26517 deleted from function.session-register by john | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-41004@lists.php.net to get a copy of this message | ||
just an add-on to my first note:
if you want the same behaviour using the $_SESSION[] array as when using session_register() pass the
variable in question by reference.
i.e:
<?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 of 3 after the fist click, just as if
you were using session_register().
greetings