我是否可以使用header()重定向到多个中间有时间间隔的URL?假设我有url1和url2。现在,我想要的是header首先重定向到url1。然后说,5秒后,它会将我重定向到url2。有什么办法可以做到这一点吗?我尝试了以下简单的代码
<?php
header("Location: url1");
header("Location: url2");
?>但这会立即将我带到url2。我希望在两者之间有一个时间间隔。如何做到这一点?提前谢谢。
发布于 2012-07-25 16:51:17
正如subirkumarsao,Martin和Edmunds所指出的,iframes是一条可行的道路。下面是最终的代码:
<html>
<iframe src="url1" width="500" height="500"> </iframe>
</html>
<?php
include('exp2.php');
?>现在,exp2.php有了一个submit按钮(出现在框架的底部),它将我带到next.php。next.php有下面的代码:
<?php
header("Location:url2");
exit();
?>https://stackoverflow.com/questions/11644020
复制相似问题