arrays passed via session
Posted: Sun Jan 22, 2006 7:10 pm
Trying to figure out how an array is being passed from a session.
This is what I have and what I'm trying to do...
There is an array that is being passed back that looks like this...
$os_version['dos'] = "on";
$os_version['win98se'] = "off";
$os_version['win2k'] = "off";
$os_version['winme'] = "off";
Displaying the $formfield array looks like this...
Array ( [os_version] => Array ( [\'dos\'] => on ) )
How can I use this data brought from a session? The following does not work....
I didn't think it would because the array is actually now $formfield['os_version'] I think.
Any help on using an array brought to page from a session would be helpful.
Thanks,
RJ
This is what I have and what I'm trying to do...
Code: Select all
if (isset($_GET['error']) or isset($_GET['missing']))
{
foreach ($_SESSION as $key => $value)
{
$formfield[$key] = $value; // converts session to $formfield
unset ($_SESSION); // Dumps the session data
}
}$os_version['dos'] = "on";
$os_version['win98se'] = "off";
$os_version['win2k'] = "off";
$os_version['winme'] = "off";
Displaying the $formfield array looks like this...
Array ( [os_version] => Array ( [\'dos\'] => on ) )
How can I use this data brought from a session? The following does not work....
Code: Select all
if ($os_version['dos'] == "on")
{
echo " Dos is on ";
}Any help on using an array brought to page from a session would be helpful.
Thanks,
RJ