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
https://forums.phpfreaks.com/topic/60360-solved-user-login-redirection/
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.  :)

Archived

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.