HarryMW Posted May 30, 2011 Share Posted May 30, 2011 Evening! I've been iffing and ahhing over this and well im not too sure, hence the post. // Redirects if there is no session id selected and echos the error on the previous page if(!isset($_GET['get']) || ($_GET['getget'])){ header("Location: #.php?error"); } So it should simply check if get is set if it isnt then see if getget is set? If not redirect and show the error. Now ive tried it and even when get/getget is set it still redirects, probably something silly. Care to share anyone? Harry. Quote Link to comment https://forums.phpfreaks.com/topic/237923-checking-if-1-session-is-active-if-not-the-other-session/ Share on other sites More sharing options...
mikesta707 Posted May 30, 2011 Share Posted May 30, 2011 you forgot the second isset function if(!isset($_GET['get']) || !isset($_GET['getget'])){ perhaps that is what you are after? EDIT: althought, if you want to have an error if neither are set, you want to use AND, not OR. IE if(!isset($_GET['get']) && !isset($_GET['getget'])){ otherwise it will redirect if either is unset. if this functionality is what you are after, leave it as OR Quote Link to comment https://forums.phpfreaks.com/topic/237923-checking-if-1-session-is-active-if-not-the-other-session/#findComment-1222593 Share on other sites More sharing options...
HarryMW Posted May 30, 2011 Author Share Posted May 30, 2011 The latter worked for me, thanks a bunch! Quote Link to comment https://forums.phpfreaks.com/topic/237923-checking-if-1-session-is-active-if-not-the-other-session/#findComment-1222596 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.