• 热门专题

在你的网站实现qq登陆(php)

作者:逗逼来了  发布日期:2015-10-09 20:02:36
Tag标签:网站  
  • 这个qq的oauth4.1有个坑,坑了我半天,后来查了不少资料总算弄通了,现在把详细步骤记录下来。

    步骤一、登陆http://connect.qq.com/

        步骤二、创建应用。我创建的是wenwutest这个应用。具体的创建如下图所示:     要特别注意这个回调地址。首先这个回调地址必须与网站地址的根域名写的一样(http://m.mumayi.com),其次,这里写的这个地址一定是登陆成功后回调的地址。不能再像oauth4.0那样再写个根域名就可以了,我这里就掉在这个坑里半天。   步骤3、下载php的sdk   下载地址:http://wiki.connect.qq.com/sdk%E4%B8%8B%E8%BD%BD 我下的是php oauth4.1的版本     下好之后,直接将整个目录放到你的服务器。如下图所示:     步骤四、配置sdk   直接访问install文件夹,填写相关信息如下图所示: STLJsBj8d6JE2sY020ko5LhJ62+L8OrKBV9TG4vc4z4YSt8sYBjYeXlD3S1nw57o+HVQ9r1wYo4v4ChdYSq7pVT3Fj/s0ftYUh3Lms1mLnud4+4gLGXixGKfSXFLBgVBYgFQJAnPT+iNhDfVICXKGQCazSaJBUBPKb2dUnQkQTfIV6edO+UhIcoZALRILAB6S+xxkDyuyGPLuhl9irIcuZG7/iStRstjy6iSizor5wW/G/YMJWvCdxtdQmIBAAAAUFwkFgAAAADFRWIBAAAAUFwkFgAAAADFRWIBAAAAUFwkFgClVPfcnkPjOlx5WB4BzdNwAQALEYkFQAm5Vs0XYhWexAIAWGRILABKiMRCYgEALBokFgC9JryCzKvJ1XHx7WTtv4p/s1XPtcMJL4ITxm3UqpVqrR6OEHwW+USOCvLb0/zPoonCkjEk0lvqpFWzFFE4UrVWCxNLo1ZtDbroX3EHACg7EguAnhJr8w25gt2oVcOKu/RLyjaWuifU3sVfWjPWzLf1SXsa0hTkIBKOpQYUt8BiXlRp1VsBpfWRZiWkBafBBQCwAJBYAPRS3YtW7lt/UFOJWPFPk1giwSH8UP1I+USck/yRYfmkxXMPLPqFU9c1TCnaaCQmFtpWAAALAY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98wzmhk5NNPPyWxAABQLiQWALnzE8uws70brr56w179Zztvrdy6UxnONryMxAIAQOmQWADkzk8sJ5293n/11f2v6z/beWvl1p3K/4PhbSOePHny5EkSCwAApUNiAZA7l8Sy81ZTP69KRUwhQWJ5vf/qSvhffxAxzpBYAABYGEgsAHLX19c3Pz9/wtlrf3/11X//mumjyurHTjy2ulIRBnlsdTvcrH7MOuX5+XkSCwAA5UJiAZA7P7G872zP31111d/t0f69ctVf//VVFe2nLkgsAACUDokFQO76+vrm5uaGjF6+/ypzl7CWbzw69PL9V33j0aGhoaGhR79hHO6q+182z2hobm6OxAIAQLmQWADkLi6xdA+JBQCA0iGxAMidn1h+WQAkFgAASofEAiB3fX19n3zyydEC+OSTT0gsAACUC4kFQO76+/tHR0enp6d/3lPT09Ojo6P9/f29Lg8AAJAAiQVA7rZs2bJt27bx8fFPemp8fHzbtm1btmzpdXkAAIAESCwAumHTpk39/f19PdXf379p06ZelwQAAEiGxAIAAACguEgsAAAAAIqLxAIAAACguEgsAAAAAIqLxAIAAACguEgsAAAAAIqLxAIAAACguEgsAAAAAIqLxAIAAACguEgsAAAAAIqLxAIAAACguEgsAAAAAIqLxAIAAACguEgsAAAAAIqLxAIAAACguEgsAAAAAIqLxAIAAACguEgsAAAAAIqLxAIAAACguEgsAAAAAIqLxAIAAACguEgsAAAAAIqLxAIAAACguEgsAAAAAIqLxAIAAACguEgsAAAAAIqLxIIyadSqlWqtYfy87tk+TTR43atUa426V7HOEAAAADkjsUDRqFUrNkL9PW5QgVdvNpt1z3Vwa5BoTU237I2a1/7UunD+9P3BDfPyE0trjqYZIrV33nlnz6uvPvnUU9/Zvv0727c/+dRTe1599Z133jEMnmC3zHTWWeyzAACgMyQWKKzNGEE13sitft+oVdWhDCM61RjF8drT0cxCtxKNWlW/wPGritSOHDny+BNP7Nu/f3h4+MKFCxcuXBgeHt63f//jTzxx5MgR3Rgd7padzDrRogAAgOyRWKDo4GJ2a1S/M5W1Tpcosdhrh5HxWtOWZiH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rcn5M65o+0LBXwePsSglwQ3fGIYYpopO4uOaAlyNpi5f1E0u/CKpmsMX7vrBSP85+bJ5vbQPrysHE4+/8OW7sYv06lvBQJ/dkacasBS0MSmL54l6fJL1dJ7GMPBe2OQv81aUg9T7yvCJ5LmVeX93u0cDavsTivTGWstaEk2uh469wSIPeVD296z/6/dMWEtHaMZZ/0UBF9KfrPQKtAueNFWIP60fRP86/T5fX989oFVCbu402eff7WOBLkVgAAIBxSSwAAMC4JBYAAGBcEgsAADAuiQUAABiXxAIAAIxLYgEAAMYlsQAAAOOSWAAAgHFJLAAAwLgkFgAAYFwSCwAAMC6JBQAAGJfEAgAAjEtiAQAAxiWxAAAA45JYAACAcUksAADAuCQWAABgXBILAAAwLokFAAAYl8QCAACMS2IBAADGJbEAAADjklgAAIBxSSwAAMC4JBYAAGBcEgsAADAuiQUAAP5m/31x/wPgAe8aHFAcRQAAAABJRU5ErkJggg==" alt="" />   填写你的应用的appid与appkey和callback地址。这个appid和appkey分别是下图所示的两个值:   最后的callback地址,一定要注意,一定要和你创建应用时候的callback地址一模一样,否则会出现"ilegal uri"错误。这里我创建应用时的callback地址是:http://m.mumayi.com/qq/example/oauth/callback.php。所以我在这里也要填写这个地址。填写完成后,点击"配置”就会配置成功了。   步骤五、访问example/index.html,点击按钮,如下所示 QTWl7bnueGxoS25l+H58vhE7vWn5tpfZH40z/pSjZLy+MRQRpyKLMvjE7rHzP6u9RsDbLiujs/iauWZkS1Tc348w/Oah0oMsPEvFGtvYXIwu3+pXn8zyjMjWc9H/upzw6ljcmLzgJ6ymv3nhclBeWxU9RxrQM67k55TJ9jx0XhueEx6NsnC+IxNLaVnoY0wTl95ZsSf5U5PDYlBTk8p5tXyfeUBcI17Ls+MhMN1fNvUiTI+Y1PLGJ+D8WpisrxQjgZZIdHpqWgAVI7P0vGn2LGoovvPxXr2N77QMS3GZ2xqaT2Hv9yj0156e9EYqOhZGPQUh5rXbHyenhoanBoNPkw7XMf4DFPoel6YHAx+0ZO/xL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XjQSHn+K3S7x93Ll8m3bn1fXS55XqXR2fDv8UOhZjtx2W1mzBsBkqT0nhlMv2uNVNtM+Ze04dblS8dqyxKPl7DkKVepZ+BLtTeKgN/pWxvUk8ty15dpVy6raTj05BpYc4dhyKew5mpaXHMWzQLHrw4THjPdcadi6+QLQN7Q9Sxd7hteKRbe021afHCrVLbvu2MmA2/fKf1RcvTOsOnHFbjOg7Tn/yafeXNbzhwj0CF7/DJiDngFz0DNgDnoGzEHPgDnoGTAHPQPmoGfAHPQMmIOeAXPQM2AOegbMQc+AOegZMAc9A+agZ8Ac9AyYg54Bc9AzYA56BsxBz4A56BkwBz0D5qBnwBz0DJiDngFz0DNgDnoGzEHPgDnSexbfgVl6N+aSk+v9WdNXKznS283GPvS8lmtLbzdbdH2g36T2XKpb0ZukN53o3Z5blYr/jtDiW6gH7xGdvQTVVRq2+L7NlYb4NvElp2rZ9ZLYZ9H1gT6T1rP0lu5yPJ7nxUZs3SNkDOPyw1bcmv8VK25NfrLodH2gn6T0nH+8FbKX5ZyWe+0g1Q/uqDItuj7QD3IeD8seir3UxsRF+TjhSJv8utqei6wP9IOcPTed+GQ7F/343HJtaTjN6rPo+kA/ytVz2sBrN1Iyz5pvR8fY8vVZdH2gv+TpueXaVdup24l+xANmOSfb8pSbnoFuytFzcNaq5MhTbsURb1HwLJA2gMt9Zh/fKro+0F8yexaOhFUaQpwt19Ye1m4fG3eaXmzKXWnYKX06zfC5o+LWLLtRyRyfM9YH+ktGz7HzurnO95bq8n51y7Wrtu0Pp/WS51Uq4R61eI1KcF+7UYn6jCm6PtBfUnuOD6eeF010lTPt9ilrx6nLdSU6jN1eqvtjeLhDLvYp7CoXXR/oL/8PjYNQStSqk+8AAAAASUVORK5CYII=" alt="" />   这样就登陆了,登录成功后跳转到我们之前设置好的callback地址。 官方sdk的callback.php文件内容如下:  
    <?php
    require_once("../../API/qqConnectAPI.php");
    $qc = new QC();
    echo $qc->qq_callback();    //返回的验证值
    echo '<hr>';
    echo $qc->get_openid();        //qq分配的用户id

    代码很简单。其中重要的是这个openid的值。一般可以将这个openid和我们现有的用户表做个绑定(如果用户有账号,如果没有,可以完善信息)。

    到这里登录就基本完成了。下面我演示下如何获取用户的基本信息,代码很简单:

    <?php
    
    /*
     *调用接口代码
     *
     **/
    require_once("../../API/qqConnectAPI.php");
    $qc = new QC();
    $arr = $qc->get_user_info();
    
    
    echo '<meta charset="UTF-8">';
    echo "<p>";
    echo "Gender:".$arr["gender"];
    echo "</p>";
    echo "<p>";
    echo "NickName:".$arr["nickname"];
    echo "</p>";
    echo "<p>";
    echo "<img src=\"".$arr['figureurl']."\">";
    echo "<p>";
    echo "<p>";
    echo "<img src=\"".$arr['figureurl_1']."\">";
    echo "<p>";
    echo "<p>";
    echo "<img src=\"".$arr['figureurl_2']."\">";
    echo "<p>";
    echo "vip:".$arr["vip"];
    echo "</p>";
    echo "level:".$arr["level"];
    echo "</p>";
    echo "is_yellow_year_vip:".$arr["is_yellow_year_vip"];
    echo "</p>";
    
    ?>
      运行以上代码显示效果如下:     是不是用户名和头像都得到了,做登录够用了吧。想怎么扩展自己去写吧。   希望能帮助到有需要的朋友,欢迎留言和我交流。
About IT165 - 广告服务 - 隐私声明 - 版权申明 - 免责条款 - 网站地图 - 网友投稿 - 联系方式
本站内容来自于互联网,仅供用于网络技术学习,学习中请遵循相关法律法规