Parse error: syntax error, unexpected 'if' (T_IF) in module php form page

di il
2 risposte

Parse error: syntax error, unexpected 'if' (T_IF) in module php form page

Hello everyone, I'm having this problem in line 15 of the code in php. would anyone be kind enough to help me? thank you. I attach code below

<?php

session_start();

if (isset($_REQUEST['submit'])) {

include 'dbh.inc.php';

$uid = mysqli_real_escape_string($conn, $_REQUEST['uid']);
$pws = mysqli_real_escape_string($conn, $_REQUEST['pwd'])

//Error handlers
//Check if inputs are empty

/*ERROR LINE*/ if (empty($uid) || empty($pwd)){
header("Location: ../index.php?login=empty");
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?login=error");
exit();

} else {
if($row = mysqli_fetch_assoc($result)) {
//DE-hashing the password
$hashedPwsCheck = password_verify($pwd, $row['user_pwd']);
if ($hashedPwsCheck == false) {
header("Location: ../index.php?login=error");
exit();
} elseif ($hashedPwdCheck == true) {
//Log in the user here
$_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_add'] = $row[user_add];
$_SESSION['u_phone'] = $row[user_phone];
$_SESSION['u_cell'] = $row[user_cell];
$_SESSION['u_bus'] = $row[user_bus];
$_SESSION['u_vat'] = $row[user_vat];
header("Location: ../index.php?login=error");
exit();
}
}
}
}
}
else {
header("location ../index.php?login=error");
exit();
}

2 Risposte

Devi accedere o registrarti per scrivere nel forum
2 risposte