Php 如何将值传递给header()函数?
我必须将用户重定向到不同的页面。 这就是我现在拥有的Php 如何将值传递给header()函数?,php,parsing,header,Php,Parsing,Header,我必须将用户重定向到不同的页面。 这就是我现在拥有的 header('Location: http://www.example.com/$confirmpage') 但它不起作用。它将它们重定向到$confirmpage(未检索到值),并给出404错误 当我使用 echo "<script>document.location='http://www.example.com/$confirmpage';</script>"; echo“document.location
header('Location: http://www.example.com/$confirmpage')
但它不起作用。它将它们重定向到$confirmpage(未检索到值),并给出404错误
当我使用
echo "<script>document.location='http://www.example.com/$confirmpage';</script>";
echo“document.location=”http://www.example.com/$confirmpage';“;
它起作用了
但出于某些原因,我不得不使用header()函数
header("Location: http://www.example.com/$confirmpage")
如果要引用php字符串中的变量,必须使用“
而不是”
如果要引用php字符串中的变量,必须使用“
而不是”
根据
$confirmpage
的内容,您可能会想要它。根据$confirmpage
的内容,您可能会想要它。