I’m foreach-ing through my POST variables (though I’m using the $_REQUEST)
I want to put all the variables into their own Session variables, but it’s simply not working.
Does this look incorrect to anyone?
<?php
foreach ($_REQUEST as $posted_name => $posted_value){
$_SESSION[$posted_name].' = '.$posted_value;
}
?>
I am including the session_start() in another part of my script. Above, of course.
There’s a big problem with this:
You don’t need to use the string concatenation
.to set a session value. This line simple evaluates to a string and doesn’t save anything in the$_SESSIONsuperglobal.Try this instead