我尝试在允许用户输入之前验证数据中的用户名和密码。这是我的代码。结果是它跳过并转到else语句
if(!empty($_POST['username']) && !empty($_POST['code']))
{
$checkcode = mysql_query("SELECT * FROM members WHERE Username = '".$username."' AND Code = '".$code."'");
if(mysql_num_rows($checkcode) == 1)
// $row = mysql_fetch_array($checkcode);
{
header("Location: home.php");
}
else
{
echo "<h1>Error</h1>";
echo "<p>Sorry, your account could not be found. Please <a href=\"index.php\">click here to try again</a>.</p>";
}
}
答案 0 :(得分:0)