micmania1 Posted July 17, 2007 Share Posted July 17, 2007 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 More sharing options...
richardw Posted July 17, 2007 Share Posted July 17, 2007 I believe the second "=" sign is your problem. Start with changing it so both values are recognized as one. Link to comment https://forums.phpfreaks.com/topic/60360-solved-user-login-redirection/#findComment-300386 Share on other sites More sharing options...
roopurt18 Posted July 17, 2007 Share Posted July 17, 2007 Why not use $_SERVER["REFERER"]? I think it contains the URI of the previously visited page. Link to comment https://forums.phpfreaks.com/topic/60360-solved-user-login-redirection/#findComment-300412 Share on other sites More sharing options...
micmania1 Posted July 18, 2007 Author Share Posted July 18, 2007 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 https://forums.phpfreaks.com/topic/60360-solved-user-login-redirection/#findComment-301589 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.