1. 程式人生 > >php重定向的方法

php重定向的方法

方法一:

   $url="shangchuan.php";
        if (isset($url))
          {
            Header("HTTP/1.1 303 See Other");
            Header("Location: $url");
            exit; //
          }

通過header請求頭重定向

方法二:


<script>url="destinationurl";window.location.href=url;</script>

通過script指令碼

方法三:

<META HTTP-EQUIV="REFRESH" CONTENT="5; URL=<? echo $url;?>>

通過meta的refresh

方法四:

<script> url="des_url";window.open(url,'','_self');</script>

和方法二類似,但可以控制開啟視窗的方式。