php重定向的方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/izzxacbbt/article/details/81257511

方法一:

   $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>

和方法二类似,但可以控制打开窗口的方式。

猜你喜欢

转载自blog.csdn.net/izzxacbbt/article/details/81257511