您好,欢迎访问一九零五行业门户网

请教QQ互联的代码是如何写的?

请问qq互联的代码是怎么写的??
error))
{
echo error: . $msg->error;
echo msg : . $msg->error_description;
exit;
}
}
//step3:使用access token来获取用户的openid
$params = array();
parse_str($response, $params);
$graph_url = https://graph.qq.com/oauth2.0/me?access_token=.$params['access_token'];
$str = file_get_contents($graph_url);
if (strpos($str, callback) !== false)
{
$lpos = strpos($str, ();
$rpos = strrpos($str, ));
$str = substr($str, $lpos + 1, $rpos - $lpos -1);
}
$user = json_decode($str);
if (isset($user->error))
{
echo error: . $user->error;
echo msg : . $user->error_description;
exit;
}
echo(hello . $user->openid);
}
else
{
echo(the state does not match. you may be a victim of csrf.);
}
?>
这是在官网弄下来的代码,
首先在网站上点击超链接,然后跳转到这个php文件,接下来怎么做呢,
云里雾里,一头雾水
分享到: