QQ登录回调地址获取用户信息

<?php
require_once("../../API/qqConnectAPI.php");
$qc = new QC();
$appid = ""; //appid 
$access_token = $qc->qq_callback();
$openid = $qc->get_openid();
//请求用户信息接口获取用户个人信息
$curl = "https://graph.qq.com/user/get_user_info?access_token=".$access_token."&oauth_consumer_key=".$appid."&openid=".$openid;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $curl);//提交到指定网页  
curl_setopt($ch, CURLOPT_HEADER, 0);//设置header  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上  
$jsonInfo = curl_exec($ch);
curl_close($ch);

// $arrInfo = json_decode($jsonInfo,true);//json 串 转数组
echo "<script>window.close();</script>";

 

posted @ 2018-02-05 14:49  不一样的开始  阅读(390)  评论(0编辑  收藏  举报