跪求qq第三方登录oauth2.0 代码 php

解决方案 »

  1.   

    刚好做完,下个SDK就OK了
    http://wiki.open.qq.com/wiki/website/SDK%E4%B8%8B%E8%BD%BD$qc = new QC();
    $qc->qq_login();$token = $qc->qq_callback();
    $openid = $qc->get_openid();
    就这么几行搞定
      

  2.   

    redirect uri is illegal(100010).这个是什么错啊,怎么解决
      

  3.   

    回调页面不正确,你要在申请appid的管理页面设置好回调的网址(http://www.xxx.com)首先你要有域名本地测试,也要设置跟管理页面一样的前缀网址(http://www.xxx.com/callback.php)当然本地测试,你可以修改hosts文件来测试
      

  4.   

    你是说在本地测试吗?那你要改windows下的hosts文件,在最后面另起一行添加
    127.0.0.1  www.xxx.com
    www.xxx.com就是你在QQ申请appid的管理页面设置好回调的网址,并且要将测试的QQ号添加到测试用户那一栏
      

  5.   

    错误:
    Warning: file_get_contents(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in D:\WWW\Connect2.0\API\class\URL.class.php on line 49Warning: file_get_contents(https://graph.qq.com/oauth2.0/token?grant_type=authorization_code&client_id=101142852&redirect_uri=www.dai.com%2FConnect2.0%2Fexample%2Foauth%2Fcallback.php&client_secret=f87a05c14b5a97ae0831584fdd34cee9&code=EEBC6839825A1F221B6C633F24D527AF): failed to open stream: No error in D:\WWW\Connect2.0\API\class\URL.class.php on line 49
    解决:public function get_contents($url){
            //if (ini_get("allow_url_fopen") == "1") {
              //  $response = file_get_contents($url);
            //}else{
                $ch = curl_init();
                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
                curl_setopt($ch, CURLOPT_URL, $url);
                $response =  curl_exec($ch);
                curl_close($ch);
            //}        //-------请求为空
            if(empty($response)){
                $this->error->showError("50001");
            }
      

  6.   

    不支持https,php.ini开启openssl
    extension=php_openssl.dll
    重启服务器
      

  7.   

    我有完整的但是已经集成到tp里面了,不好提前;建议你还是好好研究一下open_qq提供的开发文档吧,熟悉后对以后开发都有用。