解析错误:语法错误,意外';' - 第25行

时间:2018-03-06 10:47:16

标签: php syntax-error

<?php

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

include_once 'dbh.inc.php';

$Fname = mysqli_real_escape_string($conn, $_POST['Fname']);
$Lname = mysqli_real_escape_string($conn, $_POST['Lname']);
$Uname = mysqli_real_escape_string($conn, $_POST['Uname']);
$Pword = mysqli_real_escape_string($conn, $_POST['Pword']);

//ERROR HANDLERS
//Check for empty feilds

if (empty($Fname) || empty($Lname) || empty($Uname) || empty($Pword)) {

  header("Location: ../signup.php?signup=empty");
  exit();

} else {

//check if input characters are valid
    if (!preg_match("/^[a-zA-Z]*$/", $Fname) || (!preg_match("/^[a-zA-Z]*$/", $Lname)) {

      header("Location: ../signup.php?signup=invalid");
      exit();
}

else {

    $sql = "SELECT * FROM userprofile WHERE userprofile_Uname='$Uname'";
    $result = mysqli_query($conn, $sql);
    $resultcheck = mysqli_num_rows($result);

    if ($resultcheck > 0) {

      header("Location: ../signup.php?signup=usertaken");
      exit();

    } else {

// hashing the Password

    $hashedPword = password_hash($Pword, PASSWORD_DEFAULT);
    //INSERT THE USER INTO THE DATA BASE
    $sql = "INSERT INTO userprofile (Fname, Lname, Uname, Pword) VALUES ('$Fname', '$Lname', '$Uname', '$hashedPword')";

    mysqli_query($conn, $sqi);

    header("Location: ../signup.php?signup=success");
    exit();

    }
}

}
}
 else {
  header("Location: ../signup.php");
  exit();
}
?>

我在填写表单时出现错误并按下错误按下注册,错误在第25行,但在我的代码中看不到错误。

解析错误:语法错误,意外';'在第25行的/storage/ssd1/612/4681612/public_html/includes/signup.inc.php

如果有人有任何想法,那将是一个很好的帮助

非常感谢。

0 个答案:

没有答案