Php 元刷新有哪些替代重定向方法?

Php 元刷新有哪些替代重定向方法?,php,javascript,html,Php,Javascript,Html,在用户指定的特定时间后,我将重定向到一个新页面,如下所示: html_meta_redirect( 'pagename?page_number='.$f_pageNumber, user_get_pref( 'refresh_delay' )*60 ); 有哪些替代方法可以实现这一点 试试这个: <script> function getLocation() { window.location = 'placed your URL here'; } window.setTime

在用户指定的特定时间后,我将重定向到一个新页面,如下所示:

html_meta_redirect( 'pagename?page_number='.$f_pageNumber, user_get_pref( 'refresh_delay' )*60 );
有哪些替代方法可以实现这一点

试试这个:

<script>
function getLocation() {
  window.location = 'placed your URL here';
}
window.setTimeout('getLocation', 5000) // 5000 = 5 seconds
</script>

函数getLocation(){
window.location='将您的URL放在此处';
}
setTimeout('getLocation',5000)//5000=5秒

标题将重定向到welcome.html页面
请注意,在重定向之前不应该有任何echo语句

setTimeout和window.location的JavaScript代码(但它只在启用JavaScript的情况下工作)。或者使用PHP的
header
函数发送
location
header。如果您的代码格式更好,并添加一个简单的解释,这会更好:)
   <?php
    header('location:welcome.html');
    ?>