I have a 2 DHTML menus on a site... one that is displayed if someone is logged in...and the other when someone is not.
The menu is called in the body tag <body onload="init()">
I wrote a php function to try to change the menu automatically by seeing if the user had logged on or not.
the function is..
function select_menu()
{
// see if somebody is logged in
{
global $HTTP_SESSION_VARS;
if (isset($HTTP_SESSION_VARS['valid_user']))
{
echo 'onload="init2()"';
}
else
{
// they are not logged in
echo 'onload="init()"';
}
}
}
I have this function in a separate file, so the body tag looks like
<body
<?php select_menu(); ?>
>
It only seems to show the menu for users not logged in though... or no menu at all!
Am I trying to do the impossible here!
I know that user info is being passed cos I have a check_valid_user() that works!
Any ideas anyone??
Many thanks
luds