Does anyone know the meaning behind this php error message?

后端 未结 6 1957
别跟我提以往
别跟我提以往 2021-01-22 20:47

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING is the message. It came up from this line of code:

<         


        
6条回答
  •  南方客
    南方客 (楼主)
    2021-01-22 21:19

    Make sure to account for SQL injection.

    Try:

    $username = mysql_real_escape_string($_POST["user_username"]);
    $password = mysql_real_escape_string($_POST["user_password"]);
    $type = mysql_real_escape_string($_POST["uesr_type"]);
    $query = "SELECT * FROM users WHERE user_name='$username' AND password='$password' AND 
     user_type='$type'";
    
    $result = mysql_query($query);
    

提交回复
热议问题