title: My PHP login system doesn't work
body: <p>My PHP login system doesn't work. My dbms is: phpMyAdmin. The connection is done in a different 'include' file. But I can't spot where and why my login system doesn't work.</p>
  
  <p>html form:</p>
  
  <pre><code>&lt;form id="form" action='index.php' method='post' enctype="multipart/form=data"&gt;
      Username: &lt;input type='text' name='liusername'&gt;
      Password: &lt;input type='password' name='lipassword'&gt;
  
      &lt;input type='submit' value='Login'  name="lisubmit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>php code:</p>
  
  <pre><code>&lt;?php
  
      isset ($_POST ['lisubmit']) {
  
          // Run the log in script here 
          $username = strip_tags($_POST['liusername']);
          $password = strip_tags($_POST['lipassword']);
  
          //find the record in database that corresponds to this user
          $query = "SELECT user_id, user_password FROM user WHERE user_username = '".$_POST['liusername']."'";
  
          //test to see if the password from the form is dame in database
          if ($row['user_password'] == $_POST ['lipassword'] &amp;&amp; $row['user_username'] == $_POST ['liusername']) {
              $_SESSION ['loggedin'] = true;
              $_SESSION ['id'] = $row['user_id];
          } else {
              $_SESSION['loggedin'] = false;
              $_SESSION ['id'] = 0;
          }
  
          if ($_SESSION ['logginin') == true) {
              echo "&lt;p&gt;You are loggin in&lt;/p&gt;\n";
          } else {
              echo "&lt;p&gt;You are NOT logged in&lt;/p&gt;\n";
          }
  
  ?&gt;
  </code></pre>
  
  <p>database connection file:</p>
  
  <pre><code>&lt;?php
  
      session_start();
      $hostname = "localhost";
      $dbusername = "root";
      $dbpassword = "";   
      $dbase = "assignment";
  
      mysql_connect($hostname, $dbusername, $dbpassword) or die(mysql_error());
  
      mysql_select_db($dbase) or die(mysql_error());
  
  ?&gt;
  </code></pre>