当前位置: 首页>>代码示例>>PHP>>正文


PHP obj::newReg方法代码示例

本文整理汇总了PHP中obj::newReg方法的典型用法代码示例。如果您正苦于以下问题:PHP obj::newReg方法的具体用法?PHP obj::newReg怎么用?PHP obj::newReg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在obj的用法示例。


在下文中一共展示了obj::newReg方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: saveFBdetails

function saveFBdetails()
{
    $obj = new obj();
    $data = false;
    $_SESSION['fb_login'] = true;
    $_SESSION['fb_lastname'] = $_POST['fb_lastname'];
    $_SESSION['fb_firstname'] = $_POST['fb_firstname'];
    $_SESSION['fb_email'] = $_POST['fb_email'];
    $_SESSION['fb_pic'] = $_POST['fb_pic'];
    //CHECK IF EMAIL EXISTS
    $checkUser = $obj->singleData($_SESSION['fb_email'], "email", "tbl_ut_pass");
    if ($checkUser != NULL) {
        extract($checkUser);
        //IF ALREADY HAVE LC ACCOUNT
        if ($usertype == 1) {
            $usertype = 3;
            $fb_update = array('usertype' => $usertype);
            $obj->update('tbl_ut_pass', $fb_update, "WHERE uid = " . $uid);
            $_SESSION['uid'] = $uid;
        } else {
            $_SESSION['uid'] = $uid;
        }
    } else {
        $usertype = 2;
        $obj->newReg($_SESSION['fb_firstname'], $_SESSION['fb_lastname'], "tbl_ut_user");
        foreach ($obj->showLastId("tbl_ut_user", "uid") as $value) {
            extract($value);
            $_SESSION['uid'] = $value['uid'];
        }
        $fb_data = array('uid' => $uid, 'email' => $_SESSION['fb_email'], 'usertype' => $usertype);
        $obj->insert('tbl_ut_pass', $fb_data);
    }
    $_SESSION['user_lastname'] = $_POST['fb_lastname'];
    $_SESSION['user_firstname'] = $_POST['fb_firstname'];
    $_SESSION['user_pic'] = $_POST['fb_pic'];
    $data = $_SESSION['uid'];
    echo json_encode($data);
}
开发者ID:raymundcuizon,项目名称:lectureclip,代码行数:38,代码来源:api.php


注:本文中的obj::newReg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。