Example #1
0
$p = empty($_GET['p']) ? '' : sqlReplace(trim($_GET['p']));
//从订单页来的标示
$shopID = empty($_GET['shopID']) ? '0' : sqlReplace(trim($_GET['shopID']));
$shopSpot = empty($_GET['shopSpot']) ? '0' : sqlReplace(trim($_GET['shopSpot']));
$shopCircle = empty($_GET['shopCircle']) ? '0' : sqlReplace(trim($_GET['shopCircle']));
$phone = $_SESSION['phone'];
$pw = $_SESSION['pw'];
$savesession = $name . ',' . $address;
//存session
$_SESSION['reginfo2'] = $savesession;
checkData($name, '用户姓名', 1);
checkData($address, '详细地址', 1);
checkData($pw, '密码', 1);
$ip = $_SERVER['REMOTE_ADDR'];
$logincount = 1;
$vercode = getRndCode(6);
$vercodePhone = getRndCode_r(6);
$content = "验证码是" . $vercodePhone;
$_SESSION['Phone'] = $phone;
$pw = md5(md5($pw . $vercode));
//检查手机的存在
$sqlStr = "select user_id from qiyu_user where user_phone='" . $phone . "'";
$rs = mysql_query($sqlStr);
$row = mysql_fetch_assoc($rs);
if ($row) {
    alertInfo("手机号已注册", "", 1);
}
$sql = "insert into qiyu_user(user_account,user_password,user_logintime,user_loginip,user_logincount,user_mail,user_phone,user_time,user_name,user_salt,user_status,user_vcode,user_sinauid,user_sinanick,user_regtype) values('" . $phone . "','" . $pw . "',now(),'" . $ip . "','" . $logincount . "','','" . $phone . "',now(),'" . $name . "','" . $vercode . "','0','" . $vercodePhone . "','" . $sinaUid . "','" . $sinaNick . "','0')";
if (mysql_query($sql)) {
    $id = mysql_insert_id();
    $address_sql = "insert into qiyu_useraddr(useraddr_user,useraddr_phone,useraddr_address,useraddr_name) values (" . $id . ",'" . $phone . "','" . $address . "','" . $name . "')";
Example #2
0
function set_weibo($phone1, $sinaUid, $sinaNick, $QIYU_ID_USER, $password)
{
    $sql_select = "select * from qiyu_user where user_phone='" . $phone1 . "'";
    $rs_select = mysql_query($sql_select);
    $row_select = mysql_fetch_assoc($rs_select);
    if ($row_select) {
        $sqls = "select user_id from qiyu_user where user_password='******'user_salt'])) . "' and user_phone=" . $phone1 . " and user_id=" . $row_select['user_id'];
        $rss = mysql_query($sqls);
        $rows = mysql_fetch_assoc($rss);
        if (!$rows) {
            return "E";
            exit;
        }
        //修改这个用户的新浪信息
        updateUserSina($row_select['user_id'], $sinaUid, $sinaNick);
        //修改喜欢
        updateUserLike($row_select['user_id'], $QIYU_ID_USER);
        //修改地址
        updateUserADDUser($row_select['user_id'], $QIYU_ID_USER);
        //删除临时账号
        deleteUserByID($QIYU_ID_USER);
        $QIYU_ID_USER = $row_select['user_id'];
        $_SESSION['qiyu_uid'] = $QIYU_ID_USER;
    } else {
        $pw1 = getRndCode_r(6);
        //随即生成的密码
        $vercode = getRndCode(6);
        $pw = md5(md5($pw1 . $vercode));
        //发送短信
        $content = '感谢您使用<?php echo $SHOP_NAME?>网站,您今后登陆<?php echo $SHOP_NAME?>网站的帐号为您的手机号,登陆密码为' . $pw1 . '. 可在网站个人中心页面修改您的密码。稍后您将收到订单进程的短信提醒。';
        $sql_update = "update qiyu_user set user_phone='" . $phone1 . "',user_salt='" . $vercode . "',user_password='******',user_account='" . $phone1 . "' where user_id=" . $QIYU_ID_USER;
        mysql_query($sql_update) or die('插入出错');
        sendCode($phone1, $content);
    }
    $_SESSION['qiyu_temporary'] = '';
    $_SESSION['sinaNick'] = '';
}