테스트 사이트 - 개발 중인 베타 버전입니다

Parse error: syntax error, unexpected '{' 오류.. 채택완료

jessiwith 6년 전 조회 7,485

</p>

<p><?php

    if (isset($_POST['login-submit'])

        {

        include_once '../include/db.inc.php';

        $username = $_POST['userId'];

        $password = $_POST['userPw'];</p>

<p>        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(); 

                }</p>

<p>            }

            else

            {

             header("Location: ../index.php?error=nouser");

             exit(); 

            }</p>

<p>         }

         }

            }</p>

<p>            ?></p>

<p>

Parse error: syntax error, unexpected '{' in 3번 라인에  오류 같은데 ..어딘지 보이지가 않네용.ㅠ

댓글을 작성하려면 로그인이 필요합니다.

답변 3개

채택된 답변
+20 포인트
6년 전

54본째줄의 } 를 삭제해 보세요. 닫힘만 있고 열림이 없네요...^^

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

티로그
6년 전

2번 라인의 

 </code><code>if</code> <code>(isset(</code><code>$_POST</code><code>[</code><code>'login-submit'</code><code>])

 </code><code>if</code> <code>(isset(</code><code>$_POST</code><code>[</code><code>'login-submit'</code><code>]))
로 수정해보세요.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

유찬아빠

 $sql "SELECT * FROM usertable WHERE userID=? OR userPW=?;"

 

여기도 이상하네요?

 

 $sql "SELECT * FROM usertable WHERE userID=? OR userPW=? "

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인