Exemplo n.º 1
0
    $location = testInput($_POST['location']);
    $sex = testInput($_POST['sex']);
    $intro = testInput($_POST['intro']);
    $nowPlace = testInput($_POST['nowPlace']);
    $place = testInput($_POST['place']);
    $detailIntro = testInput($_POST['detailIntro']);
    $wholeProfile = array($wholeName, $location, $sex, $intro, $nowPlace, $place, $detailIntro);
    $flag = 0;
    //记录用户资料填写的是否合格,小于0为不合格
    foreach ($wholeProfile as $key => $value) {
        if (strlen($value) == 0) {
            $flag = $flag - 1;
        }
    }
    if ($flag >= 0) {
        $editResult = $logUser->editProfile($_SESSION['userid'], $wholeProfile);
        if (!$editResult) {
            echo '修改失败';
        } else {
            echo '修改成功';
        }
    } else {
        echo '不能留空';
    }
}
//修改邮箱
if ($_POST['alterEmail'] == 'alterEmail') {
    $newEmail = testInput($_POST['newEmail']);
    if (strlen($newEmail) == 0) {
        echo '邮箱不能为空';
    } else {