<?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>";
原文地址:https://www.cnblogs.com/zjj1990/p/8417561.html
时间: 2024-10-13 06:28:20