I've searched and debuges fruitlessly for the past hour and a half, so maybe someone here can help me solve my problem.
I've created an array, stored values in said array, and then when recalling the values, they seem to have disappeared. They are registered, because the code in the if (session_is_registered(...)) executes, but the valued are null. Here's a snippet of the code...
session_start();
$access_array = set_access_levels("Phantazm");
$message['header'] = "<FONT COLOR=#20FF20 SIZE=-2 FACE=ARIAL><CENTER>";
$message['footer'] = "</CENTER></FONT>";
$message['member'] = "Site Member";
$message['emailuser'] = "Email Account";
$message['trustee'] = "Trusted";
$message['staff'] = "Staff Member";
$message['fullview'] = "View All Pictures";
$message['moderator'] = "Administrator'";
$message['passwordlookup'] = "Lookup Passwords";
$message['adjustcounter'] = "Adjust Hit Counter";
$message['newpoll'] = "Change Poll";
$message['usermodify'] = "Modify User Profiles";
$message['viewlogs'] = "View Site Logs";
$message['webmaster'] = "Webmaster";
$message['DBAdmin'] = "Database Administrator";
$message['debug'] = "In Debug Mode";
$message = array($message);
session_register("message");
That's the code that registers the variables and assigns string values to them. The following code needs to retrieve the values from the array, but the variables are enpty....
session_start();
if (session_is_registered('message'))
{
$messages = array($_SESSION['message']);
if ($messages['emailuser'])
{
$stuff .= "<OPTION VALUE=\"go_email\">".$messages['emailuser'];
}
if ($messages['moderator'])
{
$stuff .= "<OPTION VALUE=\"go_moderate\">".$messages['moderator'];
}
$stuff .= "</SELECT></FORM>";
$returndata = $stuff;
}
I know this code gets executed because when I insert a debug "echo" statement, it works.. but the variables such as $messages['moderator'] are null.
I'm sure it's something simple I'm overlooking and I'll slap myself in the face when someone tells me what I've done wrong.. but I'm at my ropes end. (And by posting this, I'll probably jinx myself into solving it on my own.. as it usually happens... hehe)
Thanks in advance for any help....