我必须将用户重定向到不同的页面。 所以这里是我现在拥有的。如何将值传递给header()函数?
header('Location: http://www.example.com/$confirmpage')
但它不起作用。它将它们重定向到http://www.example.com/ $ confirmmpage(值未检索到),并给出404错误。
当我使用
echo "<script>document.location='http://www.example.com/$confirmpage';</script>";
它的工作原理。
但我必须使用header()函数出于某些原因。
取决于'$ confirmpage'的内容,您可能希望['用urlencode '](http://php.net/urlencode)它。 –