php跳转的几种方法

2023-01-07 20:49:37

一、js跳转

 

<script language="javascript">
    window.location= "http://www.baidu.com";
</script>

二、页面跳转

 

<head>
<meta http-equiv="refresh" content="10; url=http://www.baidu.com">
</head>

三、php跳转

 

<?php
header("location: http://www.baidu.com");
?>

 

如果开启curl的CURLOPT_FOLLOWLOCATION功能,则开启了location的追踪功能。curl追踪功能只认服务器返回的追踪页面,即php跳转重定向。curl对于前两种重定向,不能追踪。

 

  • 作者:daijiguo
  • 原文链接:https://daijiguo.blog.csdn.net/article/details/50267271
    更新时间:2023-01-07 20:49:37