Home > Backend Development > PHP Tutorial > url - thinkphp如何获取链接参数 求大神支招

url - thinkphp如何获取链接参数 求大神支招

WBOY
Release: 2016-06-06 20:36:51
Original
1175 people have browsed it

http://..../url/http://www.baidu.com

$url = $_GET['url'];
或者
$url= I ( 'request.url' );

打印出来 只有http:

我想问怎样才能获取到http://www.baidu.com这个链接

回复内容:

http://..../url/http://www.baidu.com

$url = $_GET['url'];
或者
$url= I ( 'request.url' );

打印出来 只有http:

我想问怎样才能获取到http://www.baidu.com这个链接

直接在链接后加?url=urlencode("http://baidu.com"),不要用/a/b的格式传这种参数

把你要获取的url 用encode 转一下 试试 ?

var_dump( parse_url($_SERVER['HTTP_REFERER']) );

thinkphp 里urlencode函数是有问题
我是这么解决的
url=str_replace("//","%%","http://baidu.com"); //%%你可以自己设置
后面你再替换回来

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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template