解析错误:语法错误,意外的';' 44行

时间:2019-05-11 01:45:23

标签: php syntax-error

我在此php页面上出错,并与大括号混淆。我希望新鲜的眼睛能帮助我找到我遗漏或放错位置的括号或括号。任何帮助将不胜感激。

我尝试在结束语句中添加额外的方括号,但我知道自己在做什么。我对此很陌生,在这一点上我已经完全迷路了。这是我正在关注的教程。该教程来自https://youtu.be/LC9GaXkdxF8

<?php
if (isset($_POST['login-submit'])) {

require 'dbh.inc.php';

$mailuid = $_POST['mailuid'];
$password = $_POST['pwd'];

if (empty($mailuid) || empty($password)) {
header("Location: ../index.php?error=emptyfields");
exit();
}
else {
$sql = "SELECT * FROM users WHERE uidUsers=? OR emailUsers=?;";
$stmt = mysqli_stmt_init($conn);
if (!mysqli_stmt_prepare($stmt, $sql)) {
header("Location: ../index.php?error=sqlerror");
exit(); 
}
else {
mysqli_stmt_bind_param($stmt, "ss", $mailuid, $mailuid);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
if ($row = mysqli_fetch_assoc($result)) {
$pwdCheck = password_verify($password, $row['pwdUsers']);
if ($pwdCheck == false) {
header("Location: ../index.php?error=wrongpwd");
exit();
}
else if ($pwdCheck == true) {
session_start();
$_SESSION['userId'] = $row['idUsers'];
$_SESSION['userUid'] = $row['uidUsers'];

header("Location: ../index.php?login=success");
exit();
}
else {
header("Location: ../index.php?error=wrongpwd");
exit(); 
}
}
else (
header("Location: ../index.php?error=nouser");
exit(); 
)
}
}
}
else {
header("Location: ../index.php");
exit(); 
}

应允许用户登录系统,但具有解析错误行44

0 个答案:

没有答案