Jump to content

Checking if 1 session is active if not, the other session.


Recommended Posts



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?



Link to comment
Share on other sites

you forgot the second isset function

if(!isset($_GET['get']) || !isset($_GET['getget'])){


perhaps that is what you are after?




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

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.