PHP/HTML 正在从 url link 中删除查询字符串
PHP/HTML Query string being removed from url link
我正在尝试传递包含完整 url;
的 link
http://xxx.co.uk/trackit.php?page=http://xxx.co.uk/game?p=buildings&menu
正如您在上面的 link 中看到的那样,首先它转到一个名为 trackit 的脚本,进行一些跟踪,然后重定向到我想要的实际页面,但是在这种情况下,'&menu' 被删除,我想我明白为什么,但一直无法修复它。
$next_page = mysqli_real_escape_string($con, $_GET['page']);
header("Location: $next_page");
任何建议都很好。
谢谢
//before display your url
$page = urlencode('http://xxx.co.uk/game?p=buildings&menu');
$url = 'http://xxx.co.uk/trackit.php?page=' . $page;
echo $url;
// displays
// http://xxx.co.uk/trackit.php?page=http%3A%2F%2Fxxx.co.uk%2Fgame%3Fp%3Dbuildings%26menu
//when you receive it on the get
$next_page = urldecode($_GET['page']);
header("Location: $next_page");
我正在尝试传递包含完整 url;
的 linkhttp://xxx.co.uk/trackit.php?page=http://xxx.co.uk/game?p=buildings&menu
正如您在上面的 link 中看到的那样,首先它转到一个名为 trackit 的脚本,进行一些跟踪,然后重定向到我想要的实际页面,但是在这种情况下,'&menu' 被删除,我想我明白为什么,但一直无法修复它。
$next_page = mysqli_real_escape_string($con, $_GET['page']);
header("Location: $next_page");
任何建议都很好。 谢谢
//before display your url
$page = urlencode('http://xxx.co.uk/game?p=buildings&menu');
$url = 'http://xxx.co.uk/trackit.php?page=' . $page;
echo $url;
// displays
// http://xxx.co.uk/trackit.php?page=http%3A%2F%2Fxxx.co.uk%2Fgame%3Fp%3Dbuildings%26menu
//when you receive it on the get
$next_page = urldecode($_GET['page']);
header("Location: $next_page");