title: Simple basic Username and Password code for 1 user not working
body: <p>I am VERY new to making websites and l am still very much learning. I have spent a huge amount of time today trying to figure out what is wrong in this piece of code I'm trying to use. Any help is much appreciated. </p>
  
  <p>Main problem is that upon submit of incorrect or correct username/password, goes to blank page and not displaying incorrect username/password message. Thanks. Steve</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form id='login' action='login.php' method='post' accept-charset='UTF-8'&gt;
      &lt;fieldset&gt;
          &lt;legend&gt;Login&lt;/legend&gt;
          &lt;input type='hidden' name='submitted' id='submitted' value='1'/&gt;
  
          &lt;label for='username' &gt;UserName: &lt;/label&gt;
          &lt;input type="text" id="UserName" name="UserName"  maxlength="50" required="true" /&gt;
  
          &lt;label for='password' &gt;Password:&lt;/label&gt;
          &lt;input type='password' name='password' id='password' maxlength="50" required="true"/&gt;
  
          &lt;input type='submit' name='Submit' value='Submit' /&gt;
      &lt;/fieldset&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>PHP</strong></p>
  
  <pre><code>&lt;?php
  
      session_start();
  
      if(isset($_POST['username'])){ 
  
          if(($_POST['username'] == "admin") &amp;&amp; ($_POST['password'] == "adminpass"))
          {
              $_SESSION['secured'] = "Secured";
          }
          else
          {
              echo "Oops! Looks like the username and password is not what I'm looking for, sorry you can't continue &lt;p&gt;&lt;a href='?'&gt;Lets try that again...&lt;/a&gt;";
          }
      }
  
  
  if(!isset($_SESSION['secured']))
  {
      echo "&lt;form method='post'&gt;
  
      &lt;form id='login' action='login.php' method='post' accept-charset='UTF-8'&gt;
          &lt;fieldset&gt;
              &lt;legend&gt;Login&lt;/legend&gt;
              &lt;input type='hidden' name='submitted' id='submitted' value='1'/&gt;
  
              &lt;label for='username' &gt;UserName: &lt;/label&gt;
              &lt;input type="text" id="UserName" name="UserName"  maxlength="50" required="true" /&gt;
  
              &lt;label for='password' &gt;Password:&lt;/label&gt;
              &lt;input type='password' name='password' id='password' maxlength="50" required="true"/&gt;
  
              &lt;input type='submit' name='Submit' value='Submit' /&gt;    
          &lt;/fieldset&gt;
      &lt;/form&gt;
  }
  else
  {
      ?&gt;
  
  
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Session Login&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;p&gt;You have been successfully logged in ... &lt;/p&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  
  
  &lt;?php 
      }
  ?&gt;
  </code></pre>