stuart7398 Posted April 10, 2008 Share Posted April 10, 2008 Hi. I have a members area. when a member logs in I want their links such as 'Profile' Personal Details' to appear in the left navigation area. how do I achieve this without losing half the page to unregistered members unless logged in? Any help is appreciated. Thanks, Stu. <?php require_once('auth.php'); ?> <code> <?php //Start session session_start(); //Check whether the session variable //SESS_MEMBER_ID is present or not if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID'])=='')) { header("location: access-denied.php"); exit(); } ?> </code> Link to comment https://forums.phpfreaks.com/topic/100503-starting-a-session/ Share on other sites More sharing options...
craygo Posted April 10, 2008 Share Posted April 10, 2008 You can make yourself 2 different navigation pages then just call the correct one depending if logged in or not <?php //Start session session_start(); require_once('auth.php'); if(!isset($_SESSION['SESS_MEMBER_ID']){ include('guestnav.php'); } else { include('usernav.php'); } ?> Ray Link to comment https://forums.phpfreaks.com/topic/100503-starting-a-session/#findComment-513984 Share on other sites More sharing options...
stuart7398 Posted April 10, 2008 Author Share Posted April 10, 2008 That's what I thought. Thanks, for confirming my thoughts. Stuart. Link to comment https://forums.phpfreaks.com/topic/100503-starting-a-session/#findComment-513988 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.