这是我的脚本,无论我做什么,我都会收到错误的密码,请帮助!
<?php
$email = $_POST['email-field'];
$password = $_POST['password-field'];
if ($email&&$password){
$connect = mysql_connect("xx","xx","xx") or die("Couldnt connect!");
mysql_select_db(xx) or die("Couldnt find db");
$query = mysql_query("SELECT * FROM users WHERE email='$email'");
$numrows = mysql_num_rows($query);
if ($numrows!=0){
while ($row = mysql_fetch_assoc($query)){
$dbemail = $row['email'];
$dbemail = $row['password'];
}
if ($username==$dbusername&&$md5password==md5($password)) {
echo "You're in!";
}else
echo "Incorrect password";
}
else
die("That user doessnt exist!");
}
else
die("Please enter a username and a password");
?>