三种页面跳转技巧

来源:互联网 发布:药学网络本科 编辑:程序博客网 时间:2024/06/11 15:52

使用HTTP头实现跳转

<?php//重定向浏览器 header("Location: http://www.baidu.com"); //确保重定向后,后续代码不会被执行 exit;?>  

使用html的meta标签

<!-- 页面在1s后跳转 --><meta http-equiv="refresh" content="1;url=http://www.baidu.com">

使用javascript实现页面跳转

<?php  $url = "http://www.baidu.com";  echo "<script>";  echo "window.location.href='$url'";  echo "</script>";  ?> 
0 0
原创粉丝点击