2011-02-14 3 views
-2

:"구문 분석 오류 : 구문 오류, C에서 예상치 못한 T_CONSTANT_ENCAPSED_STRING : XAMPP htdocs를 PP login.php 5 행에"나는이 오류 받고 있어요

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\xampp\htdocs\PP\login.php on line 5

<?php 

    $connect = mysql_connect("localhost","root","") or die("cannot connect"); 
    extract($_POST); 

    $query = "select * from user where username='".$userp."' and password='".$pwd."'"; 
    $res = mysql_query($query,$connect) or die(mysql_error() . "Query FAIL."); 
    $exist = mysql_num_rows($res); 

    if($exist == 1) 
     header("Location: user.php); 

?> 
+7

이 실패에 대한 좋은 점이 하나 있습니다. 코드를 실행하지 않지만 SQL 주입 공격에 취약하지 않습니다 ... –

답변

4
header("Location: user.php); 
         ^

없음을 가까운 견적 ...

1

결말 qoute가 없습니다. 이 시도.

if($exist==1) 
    header("Location: user.php"); 

희망이 있습니다.

P.S 여기에 몇 가지 진전이 있습니다. Google 용어 SQL 주입. 코드가 안전하지 않습니다.

관련 문제