} //修改密码 if ($_POST['alterPw'] == 'alterPw') { $oldPw = testInput($_POST['originalPw']); $newPw = testInput($_POST['newPw']); $pwConfirmed = testInput($_POST['pwConfirmed']); if (strlen($oldPw) == 0 || strlen($newPw) == 0 || strlen($pwConfirmed) == 0) { echo '请认真填写所需信息'; } else { if (!$logUser->checkPassword($_SESSION['userid'], $oldPw)) { echo $_SESSION['userid']; echo '旧密码不符合'; } elseif (!($newPw == $pwConfirmed)) { echo '两次输入密码不一致'; } else { if (!$logUser->changePassword($_SESSION['userid'], $newPw)) { echo '更改失败'; } else { //成功 } } } } ?> <div class="user-card"> <div class="user-setting-left"> <div class="setting-user-card"> <div class="setting-change-ptoto"> <div class="lib-card-heading">图片</div>