dudejma Posted August 5, 2011 Share Posted August 5, 2011 I'm wondering how to check if three sessions are set at one time. I'm assuming the error is the parentheses but I'm not sure. Thanks for the help! if(isset($_SESSION['adminid'] && $_SESSION['adminpass'] && $_SESSION['position'])) Quote Link to comment https://forums.phpfreaks.com/topic/243888-isset-session/ Share on other sites More sharing options...
gizmola Posted August 5, 2011 Share Posted August 5, 2011 isset() is a language construct in php that requires the variable you want to check be passed as a parameter. Thus you need: isset($var1) && isset($var2) etc. if you want to do what you're trying to do above. So yes... your parens are wrong. Quote Link to comment https://forums.phpfreaks.com/topic/243888-isset-session/#findComment-1252331 Share on other sites More sharing options...
dudejma Posted August 5, 2011 Author Share Posted August 5, 2011 Ohh, okay. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/243888-isset-session/#findComment-1252339 Share on other sites More sharing options...
TeNDoLLA Posted August 6, 2011 Share Posted August 6, 2011 You can also do it with "one" isset() this way: if(isset($_SESSION['adminid'], $_SESSION['adminpass'], $_SESSION['position'])) Quote Link to comment https://forums.phpfreaks.com/topic/243888-isset-session/#findComment-1253177 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.