note 10005 deleted from function.session-register by jimw
| From: | jimw@php.net | Date: | Tue, 18 Dec 2001 22:22:42 +0000 |
| Subject: | note 10005 deleted from function.session-register by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-23254@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");