note 10051 added to session_register
| From: | dig at cynosure dot com | Date: | Sun, 10 Dec 2000 03:50:14 +0000 |
| Subject: | note 10051 added to session_register | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8565@lists.php.net to get a copy of this message | ||
Something that wasn't obvious to me from the documentation:
You are registering the NAME of the variable, not the variable itself.
Correct:
$name="Bob";
session_register("name");
Wrong:
$name="Bob";
session_register($name);
In the second example, you actually end up registering a variable $Bob, which is probably undefined.
http://www.php.net/manual/function.session-register.php