title: php login button that redirects
body: <p>I am a real beginner and I made a simple <code>login.php</code> but I want to know how to make the login button redirect to another page. The script I have is:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;php
  //Start the Session
  session_start();
     
  require('connect.php');
  
  //3. If the form is submitted or not.
  //3.1 If the form is submitted
  if (isset($_POST['username']) and isset($_POST['password'])) {
      //3.1.1 Assigning posted values to variables.
      $username = $_POST['username'];
      $password = $_POST['password'];
  
      //3.1.2 Checking the values are existing in the database or not
      $query = "SELECT * FROM `user` WHERE username='$username' and password='$password'";
   
      $result = mysql_query($query) or die(mysql_error());
      $count = mysql_num_rows($result);
  
      //3.1.2 If the posted values are equal to the database values, then session will be created for the user.
      if ($count == 1) {
            $_SESSION['username'] = $username;
      } else {
          //3.1.3 If the login credentials doesn't match, he will be shown with an error message.
          echo "Invalid Login Credentials.";
      }
  }
  
  //3.1.4 if the user is logged in Greets the user with message
  if (isset($_SESSION['username'])) {
      $username = $_SESSION['username'];
      echo "Hello " . $username . "
      ";
      echo "This is the Members Area
      ";
  ?&gt;
  &lt;!DOCTYPE html&gt;
   &lt;head&gt;
  &lt;title&gt;Test Login&lt;/title&gt;
  &lt;link rel="stylesheet" type="text/css" href="style.css" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;!-- Form for logging in the users --&gt;
  
  &lt;div class="register-form"&gt;
  &lt;php
   if(isset($msg) &amp; !empty($msg)){
    echo $msg;
   }
   ?&gt;
  &lt;h1&gt;Login&lt;/h1&gt;
  &lt;form action="" method="POST"&gt;
      &lt;p&gt;&lt;label&gt;User Name : &lt;/label&gt;
   &lt;input id="username" type="text" name="username" placeholder="username" /&gt;&lt;/p&gt;
   
       &lt;p&gt;&lt;label&gt;Password&amp;nbsp;&amp;nbsp; : &lt;/label&gt;
    &lt;input id="password" type="password" name="password" placeholder="password" /&gt;&lt;/p&gt;
   
      &lt;a class="btn" href="register.php"&gt;Signup&lt;/a&gt;
      &lt;input class="btn register" type="submit" name="submit" value="Login" /&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  &lt;php } ?&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>and the page I want it to redirect to is in a called site/form.html located in the parent directory.
  Thanks for any and all input!</p>