我为登录页面编写了一小段代码。代码如下:
if($user == "" || $pass == "")
{
echo "Please fill in all the information!";
}
//Check to see if the username AND password MATCHES the username AND password in the DB
else
{
$query = mysqli_query($con,"SELECT * FROM members WHERE username = '$user' and password = '$pass'") or die("Can not query DB.");
$count = mysqli_num_rows($query);
if ($count == 1)
{
$_SESSION['username']=$user; //Create a session for the user!
header ("location: members.php");
}
else{
echo "Username and Password DO NOT MATCH! TRY AGAIN!";
}
}
我无法运行我的脚本,它返回以下错误:
PHP 解析错误:语法错误,第 38 行 /var/www/user/login.php 中的意外“if”(T_IF)(第二个“if”)