title: secure login script from wikihow
body: <p>Has anybody used this <a href="http://www.wikihow.com/Create-a-Secure-Login-Script-in-PHP-and-MySQL" rel="nofollow">script</a> from wikihow? </p>
  
  <p>By default both the login in and registering pages redirect you to "protected_page.php" the protected page is supposed to validate your login with: `</p>
  
  <pre><code>&lt;?php
  
  include_once 'includes/db_connect.php';
  include_once 'includes/functions.php';
  
  sec_session_start();
  ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;meta charset="UTF-8"&gt;
          &lt;title&gt;Secure Login: Protected Page&lt;/title&gt;
          &lt;link rel="stylesheet" href="styles/main.css" /&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;?php if (login_check($mysqli) == true) : ?&gt;
          &lt;p&gt;Welcome &lt;?php echo htmlentities($_SESSION['username']); ?&gt;!&lt;/p&gt;
              &lt;p&gt;
  </code></pre>
  
  <p>or </p>
  
  <pre><code>&lt;?php else : ?&gt;
              &lt;p&gt;
                  &lt;span class="error"&gt;You are not authorized to access this page.&lt;/span&gt; Please &lt;a href="index.php"&gt;login&lt;/a&gt;.
              &lt;/p&gt;
          &lt;?php endif; ?&gt;
  </code></pre>
  
  <p>The problem is that I always get the error msg, even though my db is configured and the registration info is sent to the db, Ive even edited the reg form to add more info without any problem on the DB side, but still I always get this error msg when trying to log in on the site. Anybody had this problem?</p>