0
在我的网站我有一个机制,当你的会话已经过期我保存当前位置并将你重定向到登录页面登录,所以URL如下获取URL,包括通过URL传递的参数作为参数
localhost/mytest/admin/login-admin.html?current=localhost/mytest/admin/manage-customer.php?action=update&id_annonceur=2
一旦您登录,我将用户重定向到存储在当前参数中的url。 问题是,当我使用下面的代码
if(isset($_GET['current']))
header('Location: http://'.$_GET['current']);
else
header('Location: ../admin/dashboard.php');
我得到无参数的URL包含在URL
http://localhost/mytest/admin/gestion-annonceur.php?action
有没有一种方法来检索完整的URL包括参数?
当您设置'$ _GET ['current']' –
时,使用'urlencode'和'urldecode'您的URL无效。你不应该有两个查询字符串(即两个'?')。您需要使用['http_build_query()'](https://php.net/http_build_query)或其他适当的方法将它传递到登录页面之前对url进行编码... – War10ck