标签: php redirect timeout
PHP在页面上放置超时并将其重定向到另一个页面时有哪些隐藏的技巧?
答案 0 :(得分:6)
您可以在服务器端使用sleep,然后使用header重定向到另一个页面。或者,您可以发送带有<meta>标记的HTML页面,该标记指定重定向位置和延迟时间。
sleep
header
<meta>
使用sleep和标题
<?php sleep(2); header('Location: http://www.example.com/'); ?>
使用<meta>代码
<meta http-equiv="refresh" content="2;url=http://www.example.com/">