duanliao3826 2014-01-26 16:46
浏览 49

第51行的PHP登录系统错误?

I'm creating a login system for a site I'm developing and this error appears when I enter a password into the password field:

Notice: Undefined variable: password in C:\xampp\htdocs\myfiles\login.php on line 51 you must enter your password

This is the code on line 51: if ($password){

This is some of the code surrounding the line:

Line 50: if ($user){

Other code surrounding the line:

echo "$user - $password <hr /> $form";
}
else
echo "you must enter your password $form";

}
else
echo "you must enter your username $form";

}
else
echo $form;

Anyone know what the problem is or could be?

  • 写回答

3条回答 默认 最新

  • douju6752 2014-01-26 16:49
    关注

    Well, the only reason you're getting this error, is because you variable isn't defined. Try to use isset(), so:

    if (isset($user) && isset($password)){
    
    评论

报告相同问题?