Easily Making Post Vars Session Vars
| From: | Jason | Date: | Mon, 14 May 2001 19:31:31 +0000 |
| Subject: | Easily Making Post Vars Session Vars | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-52726@lists.php.net to get a copy of this message | ||
Hi,
I realize you cannot override session variables through GET or POST for
security reasons. I have a complex multipage form that I would like to store
in a session for insertion in the database when the last step is completed.
The form field names are arrays, so they can be listed and inserted quite
easily (ie-custinfo[name], custinfo[state], etc).
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).
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!