brown2005 Posted March 4, 2007 Share Posted March 4, 2007 hi, if I want to stop people from viewing certain pages how would I do it? I have used if(isset($_SESSION['MembersID'])) { } else { header('location: '.$config_website_url.'/'.$config_website_url_topic.'/index.php?page=account&view=login'); } but i keep getting headers already sent message, so how would I get around this? or can't I? Quote Link to comment https://forums.phpfreaks.com/topic/41140-header/ Share on other sites More sharing options...
Orio Posted March 4, 2007 Share Posted March 4, 2007 You can't have any output before calling header(). Orio. Quote Link to comment https://forums.phpfreaks.com/topic/41140-header/#findComment-199301 Share on other sites More sharing options...
Snooble Posted March 4, 2007 Share Posted March 4, 2007 <?php if(!isset($_SESSION['MembersID'])) { header('location: '.$config_website_url.'/'.$config_website_url_topic.'/index.php?page=account&view=login'); } else { ?> PUT ALL YOUR PAGE INORMATION HERE! <?php } ?> Just changing the first statement to a negative works fine. if(!isset($_SESSION['MembersID'])) Snooble Quote Link to comment https://forums.phpfreaks.com/topic/41140-header/#findComment-199405 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.