Using if statement for simple login form PHP
<p>I'm trying to write a simple login system based on sessions in this sequence.
While logging in user at first position is working but second user isn't logging in. I can't find where the error is.
Here is the code of <strong>login.php</strong> form.</p>

<pre><code>include './user.php';

session_start();

    if (!empty($_POST['form-username'])) {

    if($_POST['form-username']==$user &amp;&amp; $_POST['form-password']==$pass){

        $_SESSION['login'] = $_POST['form-username'];
        $_SESSION['password'] = $_POST['form-password'];
        header("Location: ./dashboard.php");

    }else if($_POST['form-username']==$user2 &amp;&amp; $_POST['form-password']==$pass2){

        $_SESSION['login'] = $_POST['form-username'];
        $_SESSION['password'] = $_POST['form-password'];
        header("Location: ./dashboard.php");
    }

    else {

        header("Location: ./index.php?err");
        //exit;
    }

    }
    if(!empty($_SESSION['login'])):
        if($_SESSION['login']==$user AND $_SESSION['password']==$pass || $_SESSION['login']==$user2 AND $_SESSION['password']==$pass2){

            header("Location: ./dashboard.php");

        }
    endif;
</code></pre>

<p>And here is the code of <strong>user.php</strong> file:</p>

<pre><code>&lt;?php

   $user = 'panel1';
   $pass = 'panel123';

   $user2 ='panel2';
   $pass2 = 'panel091';
</code></pre>