示例#1
0
             
             		              //ShowMsg("通过QQ登陆帐户成功!",$url);
             					  header("Location:$url");
             			          exit;
             	             }*/
             $User = new Member(7 * 3600);
             $flag = $User->loginByQQ($openid);
             if ($flag) {
                 $url = "{$GLOBALS['cfg_basehost']}/member";
                 // ShowMsg("通过QQ登陆帐户成功!",$url);
                 header("Location:{$url}");
                 exit;
             }
         } else {
             //未存在于数据库中,跳转到注册绑定页面绑定用户.介于腾讯的霸王条款,绑定注册页面禁用.
             $user = $qq->get_user_info($openid, $token);
             $_SESSION['connectid'] = $openid;
             $_SESSION['from'] = 'qq';
             /*$pv = new View(0);
             		$pv->Fields['nickname']=$user['nickname'];
             		$pv->Fields['figureurl']=$user['figureurl'];
             		$pv->SetTemplet(dirname(__FILE__) . "/templets/index_connect.htm");
                     $pv->Display();
                     exit();*/
             $url = "{$GLOBALS['cfg_basehost']}/member/login.php?dopost=savebind&uname=" . urlencode($user['nickname']);
             $url .= "&pwd=123456789&connectid=" . $openid . '&from=qq';
             header("Location:{$url}");
             exit;
         }
     }
 }