RE: [PHP] Easily Making Post Vars Session Vars
| From: | Johnson, Kirk | Date: | Mon, 14 May 2001 20:07:06 +0000 |
| Subject: | RE: [PHP] Easily Making Post Vars Session Vars | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-52734@lists.php.net to get a copy of this message | ||
This isn't quite what you are asking, but maybe it will be of help. Use the
loop below to create and assign GLOBAL versions of the $HTTP_POST_VARS:;
reset($HTTP_POST_VARS);
while(list($key, $val) = each($HTTP_POST_VARS)) {
$GLOBALS[$key] = $val;
}
Kirk
> -----Original Message-----
> From: Jason [mailto:jason@op480.com]
> Sent: Monday, May 14, 2001 1:32 PM
> To: Php-General
> Subject: [PHP] Easily Making Post Vars Session Vars
>
>
> Hi,
>
> So, is there anyway to assign $HTTP_POST_VARS to a session
> array holding the
> same values without assign each variable one by one (there
> are a ton of
> variables).
> [snip]
> I tried doing something like this and it didn't seem to work:
> session_start();
> if(!isset($custinfo)) {
> session_register("custinfo");
> $custinfo = array();
> }
> $custinfo = $HTTP_POST_VARS;
>
>
> So, it doesn't appear it will be that easy. Anybody have any
> hints on doing
> this?
>
> Thanks!