Home >Backend Development >PHP Tutorial >怎么从url中获取一个网址,然后跳转到这个网址去

怎么从url中获取一个网址,然后跳转到这个网址去

WBOY
WBOYOriginal
2016-06-13 10:10:331127browse

如何从url中获取一个网址,然后跳转到这个网址去
比如有一个url,形式为http://www.abcd.org/go.php?&from=source&go=www.xyz.edu.cn,如何在访问这个url时跳转到go参数所代表的网址?

------解决方案--------------------
header("location:".$_GET['go']);
------解决方案--------------------

PHP code
$go='http://'.$_GET['go'];echo "<script language="javascript" type="text/javascript">";  echo "window.location.href='$go'";  echo "</script>";<div class="clear">
                 
              
              
        
            </div>
Statement:
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