I have a site that allows users to sign up and create profiles. I have a basic user profile link in the header that allows users to link back their profile page when viewing other pages. The script works fine. The problem is that now I have separate user profile pages for the two different types of users. User1 links to profile.php and User2 links to profile2.php. The issue is I'm not sure how to make the script look at the user type and display either profile.php or profile2.php based off of the status of the user that's logged in.
Here is the code I have:
<?php
if(isset($_SESSION['valid'])&&$_SESSION['valid']==true){
// INSERT USER LOGGED IN MESSAGE BELOW AS HTML
?>
<h3><a href='profile.php'><?php echo $_SESSION['userName']; ?></a></h3>
<a href="login.php?action=logout">Logout</a>
<?php
// END OF IF LOGGED IN STMT
}
?>
I basically want the script to read if User1 is logged in then link to profile.php but if User2 is logged in link to profile2.php. How can I accomplish this with the script I have?