The following code tests to see if the function is_admin($user) returns true or false when passed a user name.
If the function returns false, it is supposed to display a user menu and user header file.
If the function returns true, it is supposed to display an administrator menu and adminstrator header file.
if(!is_admin($user))
{
display_menu();
display_header('Logged In');
}
else
{
display_admin_menu();
display_admin_header('Logged in as Administrator');
}
For some reason, this code ALWAYS displays the first option. With the code written like this, it will execute display_menu() and display_header('Logged In') reguardless of the return from is_admin().
I have tried reversing the if statement to test if it returns true, rather than false as shown. I also reversed the output. With the code written like this, it will execute display_admin_menu() and display_admin_header('Logged In as Administrator') reguardless of the return from is_admin().
I have looked this code over and over, and cannot figure out what is the problem. Maybe a fresh set of eyes will help me out. Thanks in advance!
Devin