title: Redirecting to a new page after successful login
body: <p>I'm sure this question has been asked before but I have searched thoroughly for an answer but to no avail. (The only answers I've seen involve ajax) But I'm using just javascript, PHP and HTML.</p>
  
  <p>I have a login.php page and I have already created a  HTML page which is to be the landing page right after a user is successfully logged in. How do I go about this?</p>
  
  <p>The following is my code for the login page and the landing page after the login is called transfer.html:</p>
  
  <p><strong>LOGIN.PHP</strong></p>
  
  <pre><code>  &lt;div id="content"&gt;
       &lt;h3&gt;Login to Internet Banking&lt;/h3&gt;
       &lt;form id="login" action="" method="post"&gt;
          &lt;p&gt;
            &lt;label for="userid"&gt;UserID:&lt;/label&gt;
            &lt;input type="text" name="UserID" id="UserID"/&gt;
          &lt;/p&gt;
          &lt;p&gt;
            &lt;label for="PIN"&gt;PIN:&lt;/label&gt;
            &lt;input type="password" name="PIN" id="PIN" /&gt;
          &lt;/p&gt;
  
          &lt;p&gt;
            &lt;input type="submit" name="btnSend" value="Login" class="submit_button" /&gt;
  
          &lt;/p&gt;
        &lt;/form&gt;
        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
   &lt;p&gt;
          Not yet registered?
   &lt;a href="registration.php"&gt;Click here to register&lt;/a&gt;
   &lt;/p&gt;
  
    &lt;div id="wrap"&gt;
          &lt;!-- start PHP code --&gt;
          &lt;?php
  
              mysql_connect("localhost", "root", "") or die(mysql_error()); // Connect to database server(localhost) with UserID and PIN.
              mysql_select_db("registrations") or die(mysql_error()); // Select registration database.
  
              if(isset($_POST['name']) &amp;&amp; !empty($_POST['name']) AND isset($_POST['PIN']) &amp;&amp; !empty($_POST['PIN'])){
                  $UserID = mysql_escape_string($_POST['name']);
                  $PIN = mysql_escape_string(md5($_POST['PIN']));
  
                  $search = mysql_query("SELECT UserID, PIN, active FROM users WHERE UserID='".$UserID."' AND PIN='".$PIN."' AND active='1'") or die(mysql_error()); 
                  $match  = mysql_num_rows($search);
  
                  if($match &gt; 0){
                      $msg = 'Login Complete! Thanks';
                  }else{
                      $msg = 'Login Failed!&lt;br /&gt; Please make sure that you enter the correct details and that you have activated your account.';
                  }
              }
  
  
          ?&gt;
          &lt;!-- stop PHP Code --&gt;
          &lt;?php 
              if(isset($msg)){ // Check if $msg is not empty
                  echo '&lt;div class="statusmsg"&gt;'.$msg.'&lt;/div&gt;'; // Display our message and add a div around it with the class statusmsg
              } ?&gt;
  
      &lt;/div&gt;
          &lt;/div&gt;
  </code></pre>