推荐几种PHP实现页面跳转的方法

PHP实现页面跳转的方法有许多种,我们可以根据自己的需要来进行选择应用,已达到自己的需求。下面我们就为大家推荐了几种PHP实现页面跳转的方法。#t#

1.PHP实现页面跳转***种方法

  1. <?php 
  2. header("Location:http:
    //www.baidu.com");  
  3. ?> 

header()是php内置函数,用于实现页面跳转。

2.PHP实现页面跳转第二种方法:利用

 
 
 
  1. jsecho "  
  2. < script language="javascript">";  
  3. echo "location.href='www.abidu.com'";  
  4. echo "  
  5. < /script>"; 

3.PHP实现页面跳转第三种方法(利用HTML方法实现页面跳转,该方法较为实用,可以设置刷新时间,推荐使用。)

 
 
 
  1. echo  
  2.  ("http-equiv='refresh'
    content=0;URl='hehe.html'"); 

1.若是跳转到其它页面可以加上参数 index.php?id=4action=add2.取出其它页面以后参数

 
 
 
  1. $id = $_GET[id]; 
  2. $action=$_GET[action]; 

以上就是PHP实现页面跳转的具体方法。

THE END