php 判断 跳转url参数,怎么通过链接获取跳转后的url参数

本帖最后由 bing15 于 2014-09-12 14:27:23 编辑 我有一个链接,https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxcheckurl?uin=2447168038&sid=06HuH3sMX61oW3Ql&skey=%40crypt_bcc81ca8_5e4f10a91e02160feafddb694ba29185&deviceid=e333050774658970&opcode=2&requrl=https%3A%2F%2Fopen.weixin.qq.com%2Fconnect%2Foauth2%2Fauthorize%3Fappid%3Dwxdb2a2367e10c1ba6%26redirect_uri%3Dhttp%253A%252F%252Fm.lbtest.imixun.com%252Fweixin.php%26response_type%3Dcode%26scope%3Dsnsapi_base%26state%3D123%23wechat_redirect&scene=1&username=wxid_d50xcfkfwuiu12

如何获取到跳转后的url参数,

我这样写都不行

$url = 'https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxcheckurl?uin=2447168038&sid=06HuH3sMX61oW3Ql&skey=%40crypt_bcc81ca8_5e4f10a91e02160feafddb694ba29185&deviceid=e333050774658970&opcode=2&requrl=https%3A%2F%2Fopen.weixin.qq.com%2Fconnect%2Foauth2%2Fauthorize%3Fappid%3Dwxdb2a2367e10c1ba6%26redirect_uri%3Dhttp%253A%252F%252Fm.lbtest.imixun.com%252Fweixin.php%26response_type%3Dcode%26scope%3Dsnsapi_base%26state%3D123%23wechat_redirect&scene=1&username=wxid_d50xcfkfwuiu12';

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_HEADER, true);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$content = curl_exec($ch);

echo $content;

------解决思路----------------------

你这个 url 能返回什么?

直接浏览器,返回为空页面

curl 自然也不会有返回

https 是需要证书的

如确认不需要证书,则需需要有 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

但也只能得到头

HTTP/1.1 200 OK

Content-Type: text/html; charset=gbk

Cache-Control: no-cache, must-revalidate

Content-Length: 0

------解决思路----------------------

引用:Quote: 引用:你这个 url 能返回什么?

直接浏览器,返回为空页面

curl 自然也不会有返回

https 是需要证书的

如确认不需要证书,则需需要有 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

但也只能得到头

HTTP/1.1 200 OK

Content-Type: text/html; charset=gbk

Cache-Control: no-cache, must-revalidate

Content-Length: 0

在谷歌浏览器中是可以打,IE确实不行

有一个问题,在我的app中去请求微信接口的时候,会报“请在微信客户端打开链接”

我本身就是通过微信进去的啊,怎么还提示这个,下面是代码:

$encodeUrl=urlencode('http://m.lbtest.imixun.com');

$url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxdb2a2367e10c1ba6&redirect_uri='.$encodeUrl.'&response_type=code&scope=snsapi_base&state=123#wechat_redirect';

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_HEADER, true);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

$content = curl_exec($ch);

echo $content;

得设置referer他是通过referer来检测的

------解决思路----------------------

这个url是哪个接口的?

相关文章

相关视频

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值