I've been messing arround with this for the past little while and I can't seem to figure out the best way to to about doing this. Essentially, I'm trying to create a three part statement. The first will check is a session variable isset & the user has a rolecd of 2. If not, it will check to see if the session variable isset. If not, then it displays a login message. Any help would be much appreciated and I'm sorry, I just getting use to the isset construct and I'm not as familiar with it. From what I understand; however, session_is_registered is being deprecated in PHP5, so it would be best to use isset.

<?PHP
if (isset($_SESSION['UserID']) and ($_SESSION['RoleCD'] == 2)) {echo "Welcome Back Admin";} 
elseif {echo "Welcome Back <a href=\"profile.php\">".$_SESSION['FName']."</a> | <a href=\"logout.php\">Logout</a>";} 
else {echo "Not Logged In"." | <a href=\"login.php\">Login</a>";}
?>

Wouldn't you know, as soon as I post this, I figured out how to do this with a nested IF Statement as opposed to using ELSEIF. :zzz:

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.