채택완료
Parse error: syntax error, unexpected '{' 오류..
Copy
<?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개
채택된 답변
+20 포인트
답변을 작성하려면 로그인이 필요합니다.