<?php require_once "db/db_account_class.php"; $appid = $params['appid']; $appsecret = $params['appsecret']; $uid = $params['uid']; $data = array(); $account_db = new CDBAccount(); if (!$account_db) { exit; } $result = $account_db->get_phonenumber($uid); if ($result == null) { echo '{"phonenumber":"null"}'; } else { echo json_encode($result[0]); } ?>
<?php require_once "db/db_account_class.php"; if (!isset($_COOKIE['username'])) { echo '{"online":"false"}'; } else { $username = $_COOKIE['username']; $data = array(); $account_db = new CDBAccount(); if (!$account_db) { exit; } $accountinfo = null; $accountinfo = $account_db->queryAccountInfoByUsername($username); if (count($accountinfo) > 0) { $accountinfo[0]["online"] = "true"; echo json_encode($accountinfo[0]); } }
<?php require_once "db/db_client_class.php"; $account_db = new CDBAccount(); if (!$account_db) { exit; } $id = 0; if (!empty($weixin) && !empty($account)) { $res = array(); $id_status = $account_db->queryAccountInfoByAccountPasswd($account, $passwd); if (count($id_status) <= 0) { //如果账号密码不对,则查看一下账号是否存在 $id_status2 = $account_db->queryAccountInfoByAccount($account); if (count($id_status2) <= 0) { //如果账号不存在,则直接注册绑定新账号 $id = $account_db->insertAccountInfo($name, $account, $passwd, $weixin, $phone, $email, $type); } } else { //账号密码正确,直接绑定账号 $id = $account_db->bindAccountOpenid($account, $weixin); } } if ($id <= 0) { $res['register_status'] = 'failed'; } else { $res['register_status'] = 'success'; } echo json_encode($res);
<?php require_once "db/db_account_class.php"; if (isset($_Cookie['username'])) { echo '{"login_status":"success"}'; } else { $username = $params['username']; $passwd = $params['password']; $data = array(); $account_db = new CDBAccount(); if (!$account_db) { exit; } $accountinfo = null; $accountinfo = $account_db->queryAccountInfoByUsernamePasswd($username, $passwd); if (count($accountinfo) > 0) { setCookie("username", $accountinfo[0]['username'], time() + 60 * 60 * 24 * 30); $accountinfo[0]["login_status"] = "success"; echo json_encode($accountinfo[0]); } else { echo '{"login_status":"failed"}'; } }
<?php require_once "db/db_account_class.php"; $account_db = new CDBAccount(); if (!$account_db) { exit; } $username = $params['username']; $password = $params['password']; $email = $params['email']; $phonenumber = $params['phonenumber']; $site = $params['site']; $time = time(); $id = 0; $id = $account_db->insertAccountInfo($username, $phonenumber, $password, $email, $site, $time); if ($id <= 0) { $res['register_status'] = 'failed'; } else { $res['register_status'] = 'success'; } echo json_encode($res);
<?php require_once "db/db_account_class.php"; $appid = $params['appid']; $appsecret = $params['appsecret']; $phonenumber = $params['phonenumber']; $data = array(); $account_db = new CDBAccount(); if (!$account_db) { exit; } $b = $account_db->verify($appid, $appsecret, $phonenumber); if ($b) { echo '{"verify":"true"}'; } else { echo '{"verify":"false"}'; } ?>
<?php require_once "db/db_account_class.php"; $appid = $params['appid']; $appsecret = $params['appsecret']; $data = array(); $account_db = new CDBAccount(); if (!$account_db) { exit; } $uid = $account_db->request_uid($appid, $appsecret, 6, true, true); if ($uid == null) { $data['uid'] = "null"; } else { $data['uid'] = $uid; } echo json_encode($data); ?>