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?
Keep in mind that URL migt be different such as:
- www.myscript.com/clients.php?id=5
- www.myscript.com/orders.php?invoice=125
etc…
you would need to add a tracking value to your scripts, if you added this to all pages (or an element of your site which appears on every page…?)
Then in your login page, where you want the redirect you can use
$_SESSION['oldURL']