【发布时间】:2013-06-03 03:19:00
【问题描述】:
I want to combine these:
header("Location: index.php?msg=1");
header("Location: index.php#go-hear");
To look something like this:
header("Location: index.php#go-hear?msg=1");
这可能吗? 换句话说,我正在使用 _GET 并发送一个案例来过滤 switch 语句。 但我也希望页面使用锚标记重定向到页面底部,而不是顶部。
【问题讨论】:
-
锚点在最后,在任何已解析的变量之后
-
哦,标头应该是完整的 URI,而不是相对的 URI
-
您还应该在您的
header('Location: '.$URL)之后包含一个exit;调用,否则PHP 的其余部分仍然会执行。