title: My PHP/HTML submit button does not register being pressed
body: <p>Below is my code for register.php on my website. This code allows the user to register for my website, creating a MySQL entry for username, email, password, etc. on clicking the submit button.</p>
  
  <p>The button is named "reg" and uses a $_POST. Upon clicking the submit button the PHP code runs through multiple <code>if</code> statements to ensure the information the user entered is valid and does not preexist.</p>
  
  <p>If a user exists, or an error is made in submission it sets PHP variable <code>$errormessage</code> and is supposed to echo it out. Right now, my SUBMIT button does not act like it is being pressed. No error messages, no SQL row is inserted, nothing.</p>
  
  <pre><code>        &lt;?php
              if( $_POST['reg']){
  
                  /* Make sure values are correct and valid */
                  $getuser = $_POST['user'];
                  $getemail = $_POST['email'];
                  $getpass = $_POST['password'];
                  $getrepass = $_POST['retypepassword'];
  
                  /* Check to see if username entererd */
                  if($getuser){
  
                      /* Check to see if email entererd */
                      if($getemail){
  
                          /* Check to see if password entererd */
                          if($getpass){
  
                              /* Check to see if retyped password entererd */
                              if($getrepass){
  
                                  /* Check to see if passwords are the EXACT same */
                                  if($getpass === $getrepass){
  
                                      /* Check to see if VALID email is entered */
                                      if( (strlen($getemail) &gt;= 7) &amp;&amp;
                                          (strstr($getemail, "@")) &amp;&amp;
                                          (strstr($getemail, ".")) ){
  
                                          /* Email is valid mysql query */
                                          require ("./connect.php");
  
                                          $query = mysql_query("SELECT * FROM users WHERE username ='$getuser'");
  
                                          /* If mysql returns zero, the user does not exist. */
                                          $numrows = mysql_num_rows($query);
  
                                          /* Check if email exists */
                                          if($numrows == 0) {
                                              $query = mysql_query("SELECT * FROM users WHERE email ='$getemail'");
                                              $numrows = mysql_num_rows($query);
                                              if($numrows == 0){
                                                  $date = date("F d, Y");
                                                  $code = md5(rand());
  
                                                  mysql_query("INSERT INTO users VALUES ('', '$getuser', '$getpass', '$getemail', '0', '$code', '$date')");
  
                                                  $query = mysql_query ("SELECT ALL * FROM users WHERE username = '$getuser'");
                                                  $numrows = mysql_num_rows($query);
  
                                                  /* Check to make user was generated */
                                                  if($numrows == 1){
                                                      $site = "http://www.midnightnachos.com/gs";
                                                      $webmaster = "universitydb@gmail.com";
                                                      $headers = "From: $webmaster";
                                                      $subject = "Activate Your Account";
                                                      $message = "Thanks for registering. Click the link below to activate your account.\n";
                                                      $message .= "$site/activate.php?user=$getuser&amp;code=$code\n";
                                                      $message .= "You must activate your account to login.";
  
                                                      if (mail($getemail, $subject, $message, $headers)){
                                                          $errormessage = "You have been registered. You must activate your account from the activation link sent to your email.";
                                                          echo $form;
                                                          $getuser = "";
                                                          $getpass = "";
                                                      }
                                                      else
                                                          echo "An error has occured. Your activation email was not sent.";
                                                  }
                                                  else
                                                      $errormessage = "An error has occurred. Account not created.";
                                              }
                                              else
                                                  $errormessage = "Email address already in use.";
                                          }
                                          else
                                              $errormessage = "Username already exists.";
  
                                          mysql_close;
                                      }
                                      else
                                          $errormessage = "You did not enter a valid email.";
                                  }
                                  else
                                      $errormessage = "Your passwords did not match.";
                              }
                              else
                                  $errormessage = "You must retype your password.";
                          }
                          else
                              $errormessage = "You must enter your password.";
                      }
                      else
                          $errormessage = "You must enter an email to register.";
                  }
                  else
                      $errormessage = "You must enter a username to register.";
  
                  echo $form;
              }
  
              $form = "
                  &lt;div class='splash'&gt;
                    &lt;h1&gt;Register for Game Swap&lt;/h1&gt;
                    &lt;p&gt;Register for Game Swap to browse what games other local
                       users have added to their library. Propose trades,
                       chat, and meet to swap games. Your email address
                       will only be used to notify you when someone has
                       sent a trade offer. No newsletters, advertisements or
                       updates will be sent by us. We will also never sell
                       your contact information to third parties.&lt;/p&gt;
                    &lt;br /&gt;
                    &lt;p align='center'&gt;Fill out the form below to get started&lt;/p&gt;
                    &lt;br /&gt;
                    &lt;form align='center' action='./register.php' method='POST'&gt;
                        &lt;input type='text' name='user' value='$getuser' class='box' size='30' placeholder='Username' /&gt;&lt;br /&gt;
                        &lt;input type='password' name='password' class='box' size='30' placeholder='Password' /&gt;&lt;br /&gt;
                        &lt;input type='password' name='retypepassword' class='box' size='30' placeholder='Retype Password' /&gt;&lt;br /&gt;
                        &lt;input type='text' name ='email' value='$getemail' class='box' size='30' placeholder='Email Address' /&gt;&lt;br /&gt;
                        &lt;input type='button' name='reg' class='loginbutton' value='Register' /&gt;&lt;br /&gt;
                    &lt;/form&gt;
                  &lt;/div&gt;
                  &lt;br/&gt; $errormessage";
  
              echo $form;
          ?&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>