title: PHP Form not submitting data, it just reloads page
body: <p>I try to submit this form but it just reloads the page with the HTML that was above the $Query code.</p>
  
  <p>The inc/common.php is the PDO Database connection script while inc/header.php is just a place where I store stylesheets.</p>
  
  <pre><code>&lt;?php 
  ob_start();
  
  require('inc/common.php'); ?&gt;
  &lt;?php include_once "inc/header.php"; ?&gt;
   &lt;body class="register-page"&gt;
  &lt;div class="register-box"&gt;
    &lt;div class="register-logo"&gt;
      &lt;a href="../../index2.html"&gt;Our&lt;b&gt;Pet&lt;/b&gt;.net&lt;/a&gt;
    &lt;/div&gt;
    &lt;div class="register-box-body"&gt;
      &lt;p class="login-box-msg"&gt;Register a new membership&lt;/p&gt;
  &lt;?php   
      $query = " 
          SELECT 
              signupdisabled 
          FROM settings 
      "; 
  
      try 
      { 
          $stmt = $db-&gt;prepare($query); 
          $result = $stmt-&gt;execute(); 
      } 
      catch(PDOException $ex) 
      { 
          die("Failed to run query: " . $ex-&gt;getMessage()); 
      } 
  
      $row = $stmt-&gt;fetch(); 
      if($row['signupdisabled'] == 1) 
      { 
          ?&gt;
          &lt;div class="container" style="width:450px;"&gt;
              &lt;div class="alert alert-danger" style="text-align: center;"&gt;
                &lt;a class="alert-link"&gt;Registrations are currently disabled by Administrators&lt;/a&gt;
              &lt;/div&gt;
          &lt;/div&gt;&lt;?php
      }
      else
      {
      if(!empty($_POST)) 
      { 
          if(empty($_POST['username'])) 
          { ?&gt;
                              &lt;div class="container" style="width:450px;"&gt;
              &lt;div class="alert alert-danger" style="text-align: center;"&gt;
                &lt;a class="alert-link"&gt;Please enter a username.&lt;/a&gt;
              &lt;/div&gt;
              &lt;/div&gt; 
          &lt;?php } die() ?&gt;
           &lt;?php 
          if(empty($_POST['password'])) 
          { ?&gt;
                              &lt;div class="container" style="width:450px;"&gt;
              &lt;div class="alert alert-danger" style="text-align: center;"&gt;
                &lt;a class="alert-link"&gt;Please enter a password.&lt;/a&gt;
              &lt;/div&gt;
              &lt;/div&gt; 
          &lt;?php } die() ?&gt;
          &lt;?php 
  
  
          if(!filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) 
          { ?&gt;
              &lt;div class="container" style="width:450px;"&gt;
              &lt;div class="alert alert-danger" style="text-align: center;"&gt;
                &lt;a class="alert-link"&gt;Invalid eMail Address. Please Try Again.&lt;/a&gt;
              &lt;/div&gt;
              &lt;/div&gt;
  
          &lt;?php } die() ?&gt;
  &lt;?php
          $query = " 
              SELECT 
                  1 
              FROM users 
              WHERE 
                  username = :username 
          "; 
  
          $query_params = array( 
              ':username' =&gt; $_POST['username'] 
          ); 
  
          try 
          { 
              $stmt = $db-&gt;prepare($query); 
              $result = $stmt-&gt;execute($query_params); 
          } 
          catch(PDOException $ex) 
          { 
  
              die("Failed to run query: " . $ex-&gt;getMessage()); 
          } 
  
  
          $row = $stmt-&gt;fetch(); 
          if($row) 
          { ?&gt;
              &lt;div class="container" style="width:450px;"&gt;
              &lt;div class="alert alert-danger" style="text-align: center;"&gt;
                &lt;a class="alert-link"&gt;This username is already in use.&lt;/a&gt;
              &lt;/div&gt;
              &lt;/div&gt;
          &lt;?php } die() ?&gt;
          &lt;?php 
          $query = " 
              SELECT 
                  1 
              FROM users 
              WHERE 
                  email = :email 
          "; 
  
          $query_params = array( 
              ':email' =&gt; $_POST['email'] 
          ); 
  
          try 
          { 
              $stmt = $db-&gt;prepare($query); 
              $result = $stmt-&gt;execute($query_params); 
          } 
          catch(PDOException $ex) 
          { 
              die("Failed to run query: " . $ex-&gt;getMessage()); 
          } 
  
          $row = $stmt-&gt;fetch(); 
  
          if($row) 
          { 
              die("This email address is already registered"); 
          } 
  
          $query = " 
              INSERT INTO 'users' ( 
                  username, 
                  fullname, 
                  password, 
                  salt, 
                  email 
              ) VALUES ( 
                  :username, 
                  :fullname, 
                  :password, 
                  :salt, 
                  :email 
              ) 
          "; 
  
  
          $salt = dechex(mt_rand(0, 2147483647)) . dechex(mt_rand(0, 2147483647)); 
  
  
          $password = hash('sha256', $_POST['password'] . $salt); 
  
          for($round = 0; $round &lt; 65536; $round++) 
          { 
              $password = hash('sha256', $password . $salt); 
          } 
  
          $query_params = array( 
              ':username' =&gt; $_POST['username'],
              ':fullname' =&gt; $_POST['fullname'], 
              ':password' =&gt; $password, 
              ':salt' =&gt; $salt, 
              ':email' =&gt; $_POST['email']     
          ); 
  
          try 
          { 
              $stmt = $db-&gt;prepare($query); 
              $result = $stmt-&gt;execute($query_params); 
          } 
          catch(PDOException $ex) 
          { 
              die("Failed to run query: " . $ex-&gt;getMessage()); 
          } 
  
          header("Location: login.php"); 
  
          die("Redirecting to login.php"); 
  
      } 
      ?&gt; 
      &lt;form role="form" action="register.php" method="post"&gt;
        &lt;div class="form-group has-feedback"&gt;
          &lt;input class="form-control" type="text" class="form-control" name="username" placeholder="Username"/&gt;
          &lt;span class="glyphicon glyphicon-user form-control-feedback"&gt;&lt;/span&gt;
        &lt;/div&gt;
        &lt;div class="form-group has-feedback"&gt;
          &lt;input class="form-control" type="text" class="form-control" name="fullname" placeholder="Full Name"/&gt;
          &lt;span class="glyphicon glyphicon-user form-control-feedback"&gt;&lt;/span&gt;
        &lt;/div&gt;          
        &lt;div class="form-group has-feedback"&gt;
          &lt;input class="form-control" type="email" class="form-control" name="email" placeholder="Email" required/&gt;
          &lt;span class="glyphicon glyphicon-envelope form-control-feedback"&gt;&lt;/span&gt;
        &lt;/div&gt;
        &lt;div class="form-group has-feedback"&gt;
          &lt;input class="form-control" type="password" class="form-control" name="password" placeholder="Password" required/&gt;
          &lt;span class="glyphicon glyphicon-lock form-control-feedback"&gt;&lt;/span&gt;
        &lt;/div&gt;
        &lt;div class="row"&gt;
          &lt;div class="col-xs-8"&gt;    
            &lt;div class="checkbox icheck"&gt;
              &lt;label&gt;
                &lt;input type="checkbox"&gt; I agree to the &lt;a href="#"&gt;terms&lt;/a&gt;
              &lt;/label&gt;
            &lt;/div&gt;                        
          &lt;/div&gt;&lt;!-- /.col --&gt;
          &lt;div class="col-xs-4"&gt;
            &lt;button class="btn btn-primary btn-block btn-flat" type="submit"&gt;Register&lt;/button&gt;
          &lt;/div&gt;&lt;!-- /.col --&gt;
        &lt;/div&gt;
      &lt;/form&gt;        
  
      &lt;a href="login.html" class="text-center"&gt;I already have a membership&lt;/a&gt;
    &lt;/div&gt;&lt;!-- /.form-box --&gt;
  &lt;/div&gt;&lt;!-- /.register-box --&gt;
      &lt;?php } ?&gt;
  
  &lt;?php include_once "inc/footer-lr.php"; ?&gt;
  </code></pre>
  
  <p>Could anyone try to help me please?</p>