$appid = "101353491";

        $appkey = "df4e46ba7da52f787c6e3336d30526e4";

        $redirect_uri = "http://www.iwebshop.com/index.php";
$redirect_uri = urlencode($redirect_uri);
$url = "https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id={$appid}&redirect_uri={$redirect_uri}&state=123";
$code = $_GET['code'];
//通过Authorization Code获取Access Token
$acurl = "https://graph.qq.com/oauth2.0/token?grant_type=authorization_code&client_id={$appid}&client_secret={$appkey}&code={$code}&redirect_uri={$redirect_uri}";
$acstr = file_get_contents($acurl);
$acarr = explode('&',$acstr);
$acstr = explode('=',$acarr[0]);
$access_token = $acstr[1];
$opurl = "https://graph.qq.com/oauth2.0/me?access_token={$access_token}";
$oparr = file_get_contents($opurl);
$opstr = substr($oparr,10);
$opstr = substr($opstr,0,-4);
$opstr = json_decode($opstr,true);
$openid = $opstr['openid'];
$userinfourl = "https://graph.qq.com/user/get_user_info?access_token={$access_token}&oauth_consumer_key={$appid}&openid={$openid}";
$userinfo = file_get_contents($userinfourl);
echo "<pre>";
var_dump($userinfo);

最新文章

  1. C#调用百度高精度IP定位API通过IP获取地址
  2. Red Gate(SQLToolbelt)SQL Server的安装与注册(破解)
  3. Winodow Server Backup学习向导-window 2008
  4. HOLOLENS的DEVICE POTAL连接和安装
  5. ionic cordova 热更新
  6. 通信vue2.0组件
  7. vbox共享文件 挂载
  8. Synchronized及其实现原理
  9. Http状态总结
  10. Android 通过程序添加桌面快捷方式
  11. Android之界面刷新(invalidate和postInvalidate使用)
  12. PHP 获取文件权限函数
  13. android map高德地图显示多个点,并且每个marker点可以响应鼠标点击事件,处理跳转页面
  14. HDU 4633 Who&#39;s Aunt Zhang (Polya定理+快速幂)
  15. javascript获取浏览器窗口大小办法
  16. Coding the Matrix Week 1 The Vector Space作业
  17. 用备份控制文件做不完全恢复下的完全恢复(数据文件备份&lt;旧&gt;--新建表空间--控制文件备份&lt;次新&gt;--日志归档文件&lt;新&gt;)
  18. Mongo 专题
  19. MySQL skip-character-set-client-handshake导致的一个字符集问题
  20. Project Euler Problem9

热门文章

  1. sleep() 、join()、yield()有什么区别
  2. Unity3D_(游戏)甜品消消乐01_游戏基础界面
  3. 第七周总结&amp;第五次实验报告
  4. 第九周总结&amp;实验报告七
  5. AJAX请求和普通HTTP请求区别
  6. Ruby的异常处理
  7. D5(太长了md没写完)
  8. leetcode 75颜色分类
  9. WPF界面设计—撸大师
  10. [Nova] Failed to get shared "write" lock Is another process using the image?