一定时间后页面重定向PHP [英] Page redirect after certain time PHP
本文介绍了一定时间后页面重定向PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有一些PHP函数可以在一段时间后进行重定向.我在某个地方看到过它,但记不起来了.就像登录后的gmail重定向一样.请有人提醒我吗?
There is a certain PHP function for redirecting after some time. I saw it somewhere but can't remember. It's like the gmail redirection after logging in. Please, could anyone remind me?
推荐答案
header( "refresh:5;url=wherever.php" );
这是设置header
的php方法,它将在 5秒
this is the php way to set header
which will redirect you to wherever.php
in 5 seconds
请记住,在发送任何实际输出之前,必须通过常规HTML标记,文件中的空白行或从PHP调用header().读取包含,或要求函数或另一个文件访问函数的代码,并在调用header()之前输出空格或空行,这是一个非常常见的错误.使用单个PHP/HTML文件时,存在相同的问题. (来源 php.net )
这篇关于一定时间后页面重定向PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文