php - Getting URL including parameters passed in an URL as a parameter -
in website have mechanism when session has expired save current location , redirect login page log on, url follow
localhost/mytest/admin/login-admin.html?current=localhost/mytest/admin/manage-customer.php?action=update&id_annonceur=2
once logged in, redirect user url stored in current parameter. problem when use following code
if(isset($_get['current'])) header('location: http://'.$_get['current']); else header('location: ../admin/dashboard.php');
i url without parameters included in url
http://localhost/mytest/admin/gestion-annonceur.php?action
is there way retrieve complete url including parameters?
make sure url-encode original url when put current
parameter. should be:
localhost/mytest/admin/login-admin.html?current=localhost%2fmytest%2fadmin%2fmanage-customer.php%3faction%3dupdate%26id_annonceur%3d2
use urlencode()
php function generate encoding.
Comments
Post a Comment