Re: Converting HTTP_POST_VARS to HTTP_SESSION_VARS !
| From: | Yasuo Ohgaki | Date: | Sat, 04 Aug 2001 19:32:02 +0000 |
| Subject: | Re: Converting HTTP_POST_VARS to HTTP_SESSION_VARS ! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61263@lists.php.net to get a copy of this message | ||
"Peter Dowie" <pete@smackedout.com> wrote in message
news:001201c11d08$1b3fe280$021ea8c0@petexp...
> Hi,
>
> I'm using sessions and everytime my script is called, I want to add
all
> elements of $HTTP_POST_VARS to my $HTTP_SESSION_VARS
> so that I can access them throughout the session.
> I cant seem to get this working. This is what I have:
>
Why you don't use HTTP_SESSION_VARS???
You don't need to use ression_register/unregister() with
$HTTP_SESSION_VARS.
Do
foreach($HTTP_POST_VARS as $k => $v) {
$HTTP_SESSIN_VARS[$k] = $v;
}
OR
$HTTP_SESSION_VARS = array_merge($HTTP_SESSION_VARS, $HTTP_POST_VARS);
Important: This kind of code is VERY dangarous unless you check all
$HTTP_POST_VARS and you are sure safe to do that.
>
> Also what is register_globals ?? Should I have this on or off ?
off. unless you must use app assumes its on, and cannot fix it.
Much easier to write secure code with register_globals=off. (And a
little bit faster)
Regards
--
Yasuo Ohgaki