note 10005 added to session_register
| From: | chet at crashed dot net | Date: | Wed, 06 Dec 2000 17:32:48 +0000 |
| Subject: | note 10005 added to session_register | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8481@lists.php.net to get a copy of this message | ||
For those of you who have the need to change session variable that have already been set through the
GET method. Here's a handy little solution:
Create yourself a utility function like the following:
function rereg(&$variable, $string) {
session_register($string);
if (isset($HTTP_GET_VARS[$string])) { $variable = $HTTP_GET_VARS[$string]; }
}
Then call it like this if you wanted to change a session variable from the GET data:
rereg($happy_user, "happy_user");
http://www.php.net/manual/function.session-register.php