I’m not sure which is the best way to do this, so I would love to hear some ideas.
Ok, let’s say we have this link/url => www.myscript.com/clients.php?id=5
If I try to open it, I get redirected to www.myscript.com/login.php, because I’m not logged in, and then when I get logged in I don’t get redirected to original link/url www.myscript.com/clients.php?id=5 as I would like to.
So what should I add to login.php to achieve such acting/working?
I would change the bit of code that redirects you to the login page if you’re not logged in.
Rather than redirecting to login.php, do this:
On the login page, add
$_GET['from']to a hidden form element, or something.Once the login is verified, redirect (remember to
urldecode()first!).