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? 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. 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 Link to comment https://forums.phpfreaks.com/topic/41140-header/#findComment-199405 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.