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 ? Quote 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"; } ?> Quote 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! ^ Quote 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 (*) Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.