[英]PHP, redirect to another page
How in a PHP script do I redirect to another page? 如何在PHP脚本中重定向到另一个页面? I tried
header
, but this didn't work since before my header() statement is an echo. 我尝试过
header
,但是这在我的header()语句是echo之前没有用。
This, I do not want to use: 这个,我不想用:
echo "<meta http-equiv='refresh' content='1;URL=?".$link."'>";
You would want to do the following: 您可能希望执行以下操作:
header('Location: http://www.someURL.com');
But this must be done before anything is dropped to the output steam. 但是必须在将任何东西放到输出蒸汽之前完成。 Also you would not want to use
你也不想使用
echo "<meta http-equiv='refresh' content='1;URL=?".$link."'>";
As it would force the browser to reload your page, effectively rendering it useless if the user is trying to click a link or type something just as it refreshes. 因为它会强制浏览器重新加载页面,如果用户尝试单击链接或在刷新时键入内容,则有效地使其无效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.