jamesxg1 Posted March 3, 2009 Share Posted March 3, 2009 i need to make a if function that will disallow the page to be viewed if the $_SESSION['logged'] does not exist. anyone have any idea's ? Link to comment https://forums.phpfreaks.com/topic/147739-solved-what-if-function-do-i-use-for-this/ Share on other sites More sharing options...
HuggieBear Posted March 3, 2009 Share Posted March 3, 2009 <?php if (!isset($_SESSION['logged'])){ echo "You aren't logged in"; } else { echo "You're allowed to see the page"; } ?> Link to comment https://forums.phpfreaks.com/topic/147739-solved-what-if-function-do-i-use-for-this/#findComment-775523 Share on other sites More sharing options...
brentech Posted March 3, 2009 Share Posted March 3, 2009 i need to make a if function that will disallow the page to be viewed if the $_SESSION['logged'] does not exist. anyone have any idea's ? if (isset($_SESSION['logged'])) { display page } else { do nothing } ---- edit: what he said! ^ Link to comment https://forums.phpfreaks.com/topic/147739-solved-what-if-function-do-i-use-for-this/#findComment-775525 Share on other sites More sharing options...
jamesxg1 Posted March 3, 2009 Author Share Posted March 3, 2009 <?php if (!isset($_SESSION['logged'])){ echo "You aren't logged in"; } else { echo "You're allowed to see the page"; } ?> worked thanks (*) Link to comment https://forums.phpfreaks.com/topic/147739-solved-what-if-function-do-i-use-for-this/#findComment-775527 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.