Parse error: syntax error, unexpected '{' 오류..
본문
<?php
if (isset($_POST['login-submit'])
{
include_once '../include/db.inc.php';
$username = $_POST['userId'];
$password = $_POST['userPw'];
if (empty($username) || (empty($password))
{
header("Location: ../index.php?error=emptyfields");
exit();
}
else
{
$sql = "SELECT * FROM usertable WHERE userID=? OR userPW=?;";
$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" , $username , $password);
mysqli_stmt_exectue($stmt);
$result = mysqli_stmt_get_result($stmt);
if ($row = mysqli_fetch_assoc())
{
$pwdCheck = password_verify($password, $row['userPW']);
if ($pwdCheck == false)
{
header("Location: ../index.php?error=wrongpwd");
exit();
}
else if($pwdCheck == true)
{
session_start();
$_SESSION['userNo'] = $row('userNO');
$_SESSION['userId'] = $row('userID');
header("Location: ../index.php?login=sucess");
exit();
}
else
{
header("Location: ../index.php?error=wrongpwd");
exit();
}
}
else
{
header("Location: ../index.php?error=nouser");
exit();
}
}
}
}
?>
Parse error: syntax error, unexpected '{' in 3번 라인에 오류 같은데 ..어딘지 보이지가 않네용.ㅠ
!-->답변 3
54본째줄의 } 를 삭제해 보세요. 닫힘만 있고 열림이 없네요...^^
$sql
=
"SELECT * FROM usertable WHERE userID=? OR userPW=?;"
;
여기도 이상하네요?
$sql
=
"SELECT * FROM usertable WHERE userID=? OR userPW=? "
;
2번 라인의
를 if (isset($_POST['login-submit'])
로 수정해보세요. if (isset($_POST['login-submit']))
답변을 작성하시기 전에 로그인 해주세요.