这是非常奇怪的看到php头函数修改查询字符串,如果它是一个URL。我使用了这样的header函数header('Location: http://www.example.com/account-type?goto=http://www.google.com/hello');
这是重定向到http://www.example.com/account-type?goto=http/hello
修改后的查询字符串
header('Location: /account-type?goto=http://www.google.com/hello');
这将重定向到http://www.example.com/account-type?goto=http://www.google.com/hello
谁能告诉我如何解决这个问题?
我猜这只是编码的问题。试试这个:
$url = urlencode('http://www.google.com/hello');
header('Location: http://www.example.com/account-type?goto=' . $url);