Jump to content

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


HarryMW
 Share

Recommended Posts

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.

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?

 

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

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • 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.