php实现页面跳转及限时跳转的几种方法:
1.使用php里head函数进行跳转
header("refresh:3;url=http://www.yanue.net");//限时跳转 header('location:http://www.yanue.net');//立即跳转
注意:head跳转前不要有任何输出,不然可能不能跳转.
2. HTML meta refresh 刷新与跳转(重定向)页面
refresh 属性值 -- 刷新与跳转(重定向)页面
- refresh用于刷新与跳转(重定向)页面
- refresh出现在http-equiv属性中,使用content属性表示刷新或跳转的开始时间与跳转的网址
<meta http-equiv="refresh" content="3; url=http://www.yanue.net">
3.js实现页面跳转
<script type='text/javascript'> // 立即跳转 window.location.href = 'http://www.yanue.net'; // 限时跳转 setTimeout(function(){ // 3秒后跳转 window.location.href = 'http://www.yanue.net'; },3000); </script>js实现跳转主要用到location对象
转载请注明:半叶寒羽
» php实现页面跳转及限时跳转的几种方法