Parse error: syntax error, unexpected ';' in on line 7
I been looking for a while but I think I have been over looking it. I been doing this all day so. I can not find the problem.
<?php
if (isset($_POST['login'])) {
require 'dbh.inc.php';
$logUid = $_POST['logUid'];
$logPwd = $_POST['logPwd'];
if (empty($logUid) || (empty($logPwd)) {
header("Location: ../login.php?error=emptyfields");
exit();
}
else {
$sql = "SELECT * FROM users WHERE uidUsers=?;";
$stmt = mysqli_stmt_init($conn);
if (!mysqli_stmt_prepare($stmt, $sql)) {
header("Location: ../login.php?error=sqli");
exit();
} else {
mysqli_stmt_bind_param($stmt, "s", $logUid);
mysqli_stmt_execute($stmt);
$result = mysqli_stmt_get_result($stmt);
if ($row = mysqli_fetch_assoc($result)) {
$pwdCheck = password_verify($logPwd, $row['pwdUsers']);
if ($pwdCheck == false) {
header("Location: ../login.php?error=wrong");
exit();
}
else if($pwdCheck == true) {
session_start();
$_SESSION['username'] = $row['uidUser'];
$_SESSION['email'] = $row['emailUsers'];
header("Location: ../index.php?login");
exit();
} else {
header("Location: ../login.php?error=usernotfound");
exit();
}
}
}
}
}
else{
header("Location: ../login.php");
exit();
}
?>