Perfidus Posted January 22, 2008 Share Posted January 22, 2008 I would like to store the values from a form inside the session vars without extracting every single one, just want to put the array inside the session array. I'm afraid I'm a little obfuscated at the moment to clear out if this syntax is any good... Any tips? Should I make a loop to place them with index numbers? What should I do? Quote Link to comment https://forums.phpfreaks.com/topic/87204-http_session_varshttp_post_vars-possible/ Share on other sites More sharing options...
rajivgonsalves Posted January 22, 2008 Share Posted January 22, 2008 yes its possible however you should us array_merge $HTTP_SESSION_VARS=array_merge($HTTP_SESSION_VARS,$HTTP_POST_VARS); Quote Link to comment https://forums.phpfreaks.com/topic/87204-http_session_varshttp_post_vars-possible/#findComment-446025 Share on other sites More sharing options...
aschk Posted January 22, 2008 Share Posted January 22, 2008 You should also hand over "all your base are belong to us"... Anyone smell some injection? Quote Link to comment https://forums.phpfreaks.com/topic/87204-http_session_varshttp_post_vars-possible/#findComment-446039 Share on other sites More sharing options...
kenrbnsn Posted January 22, 2008 Share Posted January 22, 2008 You shouldn't use the long array names "HTTP_*", since those are going away. Use $_POST, $_SESSION, etc. You can do something like: <?php $_SESSION['POST'] = $_POST; ?> That would put the $_POST array into the session variable POST. You can also do: <?php foreach ($_POST as $key => $val) $_SESSION[$key] = $val; ?> To aschk: No, there is no injection going on here. The OP probably just wants to store the information coming from a POSTed form. Ken Quote Link to comment https://forums.phpfreaks.com/topic/87204-http_session_varshttp_post_vars-possible/#findComment-446065 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.