0

I keep getting this error:

" Notice: Undefined variable: pass ... on line 17 select * from users where email='alpha@yahoo.com' && pass ='' "

I just cant figure it out, i clearly set this there : $pass=$_POST['pass'];

    if (isset($_POST['email'])) {
        $email=$_POST['email'];
    }

    if (isset($_POST['pass'])) {
        $pass=$_POST['pass'];
    }

    $s="select * from users where email='$email' && pass ='$pass' ";
Cereegolas
  • 11
  • 3
  • 1
    **Never store plain text passwords!** Please use ***PHP's [built-in functions](http://jayblanchard.net/proper_password_hashing_with_PHP.html)*** to handle password security. If you're using a PHP version less than 5.5 you can use the `password_hash()` [compatibility pack](https://github.com/ircmaxell/password_compat). ***It is not necessary to [escape passwords](http://stackoverflow.com/q/36628418/1011527)*** or use any other cleansing mechanism on them before hashing. Doing so *changes* the password and causes unnecessary additional coding. – Jay Blanchard Aug 22 '19 at 13:26
  • 1
    Show us the markup for your form. – Jay Blanchard Aug 22 '19 at 13:27
  • 1
    @FoulFoot what makes you say that? Edit: There is nothing wrong with their syntax. Yours is just written in another way which makes no difference. – Funk Forty Niner Aug 22 '19 at 13:41
  • @Funk Forty Niner you're right! I've never seen that alternate syntax... it looks very wrong to me. @Cereegolas `$_POST['pass']` is not set. That's the only explanation. – FoulFoot Aug 22 '19 at 13:52

0 Answers0