예제 #1
0
<?php

session_start();
//购物车相关ajax数据处理
include "../common.inc.php";
InitGP(array("action", "remark", "gid", "num", "gids", "cityid"));
//初始化变量全局返回
include INC_PATH . "/member.class.php";
$m = new memberclass();
AjaxHead();
if ($action == 'checkemail') {
    $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
    $email = $jsondata->email;
    $info = $m->checkemail($email, true);
    echo json_encode($info);
    exit;
} else {
    if ($action == 'checkuname') {
        $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
        $username = $jsondata->username;
        $info = $m->checkuname($username, true);
        echo json_encode($info);
        exit;
    } elseif ($action == 'checkcode') {
        InitGP(array("code"));
        //初始化变量全局返回
        include INC_PATH . "/code/securimage.php";
        $img = new Securimage();
        $valid = $img->check($code);
        if ($valid != true) {
            exit('0');
예제 #2
0
                print "<script language='javascript'>alert(" . lang('update_lose') . ");</script>";
                jumpurl(url('m.php?name=edituserinfo'));
                exit;
            }
        } else {
            print "<script language='javascript'>alert(" . lang('update_lose') . ");</script>";
            jumpurl(url('m.php?name=edituserinfo'));
            exit;
        }
    } else {
        $value = $m->getone($_USERS['uname']);
    }
} elseif ($action == 'checkemail') {
    $jsondata = json_decode(str_replace("'", '"', file_get_contents('php://input')));
    if (isemail($jsondata->email)) {
        $info = $m->checkemail($jsondata->email);
        if ($info == "OK") {
            exit(json_encode('OK'));
        } else {
            exit(json_encode($info));
        }
    } else {
        exit(json_encode(lang('Malformed')));
    }
} elseif ($action == 'checkcode') {
    InitGP(array("code"));
    //初始化变量全局返回
    include INC_PATH . "/code/securimage.php";
    $img = new Securimage();
    $valid = $img->check($code);
    if ($valid != true) {