CI框架开发新浪微博登录接口源码完整版(4)

public function login_validation(){
      //第三方登录用户id ,sina_id,qq_id的记录增改
        $third_info =array(
            "user_id" => $user_ser['id'],
            "sina_id" => $this->session->userdata('sina_id'),
            "qq_id"   =>$this->session->userdata('qq_id'),
        );
        if($third_info['sina_id']||$third_info['qq_id'])    $this->third->binding_third($third_info);  // 绑定
}

//保存


     //在注册控制器里,用户信息写入user_reg表,同时也把sina_id写入third_login表,我这里只展示第三方登录接口用户id存入数据表的代码
class Register extends CI_Controller {

public function __construct() {
        parent::__construct();
        $this->load->library('session');
    }
    public function reg() {
          $haha =array(
                      "user_id" => $rs,
                      "sina_id" => $this->session->userdata('sina_id'),
                      "qq_id"   =>$this->session->userdata('qq_id'),
                      );
            if($haha['sina_id']||$haha['qq_id'])    $this->third->binding_third($haha);
    }
}

保存

6.视图文件布置新浪微博登录按钮,在application/view下建立index.php文件,代码:

复制代码 代码如下:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/eef30f4b459f6695dc6b07a12036c00e.html