Home > php教程 > php手册 > body text

php URL跳转代码

WBOY
Release: 2016-06-13 09:32:33
Original
859 people have browsed it

 URL跳转代码  1.代码:  $url=$_GET["url"];header("Location:"."http://".$url);?> 如保存为aaa.php,可以实现aaa.php?url=www.baidu.com跳转到百度的效果.  这个简单的调用了默认的$_GET变量.以及php默认跳转Location: 2.实例升级:增加if循环  代码:  复制代码 代码如下:   $url=$_GET["url"];  if (strlen($url >=3)){  header("Location:"."http://".$url);  }  ?>   

  URL转向页     
     
   
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template