我是一个新的php程序员,所以很难捕捉错误。如果有人能解释这个错误对我会有很大帮助的
在几个联机调试器中运行php时,我继续收到错误消息:
语法错误:第11行的语法错误,意外的“退出”(TSeExt)
但是我不相信是这样…有人能帮我吗?
if (isset($_POST['submit'])) {
include_once 'dbh.inc.php';
$uid = $_POST['uid'];
$pwd = $_POST['pwd'];
if (empty($uid) || empty($pwd)) {
header("Location: ../index.php")
exit()
} else {
$sql = "SELECT * FROM users WHERE user_uid ='$uid'";
$result= mysqli_query($conn, $sql);
$resultcheck = mysqli_num_rows($result);
if ($resultcheck < 1) {
header("Location: ../index.php")
exit()
} else {
if ($row = mysqli_fetch_assoc($result)) {
$hashedPwdCheck = password_verify($pwd, $row['user_pwd']);
if ($hashedPwdCheck == false) {
header("Location: ../index.php")
exit()
} elseif($hashedPwdCheck == true) {
$_SESSION['u_id'] = $row['user_id'];
$_SESSION['u_first'] = $row['user_first'];
$_SESSION['u_last'] = $row['user_last'];
$_SESSION['u_email'] = $row['user_email'];
$_SESSION['u_uid'] = $row['user_uid'];
echo "Correct";
}
}
}
}
} else {
header("Location: ../index.php?login=error")
exit()
}
?>