我有一个 HTML 页面,上面有一个简单的表单,可以将数据提交到 login.php。在 login.php 里面我有这个代码。当我尝试执行此脚本时,我收到此错误:
解析错误:语法错误,第 13 行 /home/login.php 中的意外 T_VARIABLE
<?php
$username = $_POST['login'];
$password = $_POST['password'];
if ($username&&$password) {
$connect = mysql_connect("localhost", "admin", "1455m") or die("Couldn't Connect");
mysql_select_db("lr") or die("Couldn't find database!");
$query = mysql_query("SELECT * FROM users WHERE username='$username'")
$numrows = mysql_num_rows($query);
if ($numrows!=0) {
while ($row = mysql_fetch_assoc($query)) {
$dbusername = $row['username'];
$dbpassword = $row['password'];
}
if ($username==$dbusername&&$password==$dbpassword) {
echo 'You are In!';
} else {
echo 'Incorrect Password!';
}
} else {
die("That user doesn't exist.");
}
} else {
die("Please enter a username & password.");
}
?>