Jump to content

[SOLVED] User login redirection


micmania1

Recommended Posts

If a user is not logged in on my site and goes to a page which they need to be, they are redirected to the login page. When they login, they are redirected to the page they were pm.

 

The preoblem is, if there are 2 $_GET values, it only reads the first.

 

Example:

http://www.mydomain.com/page.php?get=value&get2=value2

 

http://www.mydomain.com/login.php?redirect=http://www.mydomain.com/page.php?get=value

 

$_GET['get2'] is not in the login.php url.

 

 

I am using $_SERVER['REQUEST_URI']

 

Can anybody help?

Link to comment
Share on other sites

Why not use $_SERVER["REFERER"]?  I think it contains the URI of the previously visited page.

 

I remember trying something like this when I first made it but there was a problem. Can't remember what it was now but it works now anyway.

 

Thanks for your help and sorry for being thick.  :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.

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