title: PHP isset function is not checking properly
body: <p>When the button is clicked. I want to get the values from the form using the register_button. However, it does not get inside the if clause. </p>
  
  <p>I can not check anything typed at the form within the if statement.
  Is there any other options that I can retrieve data from the form with or am I doing some mistake?</p>
  
  <p><code>var_dump($_POST)</code> returns </p>
  
  <pre><code>array(6) { 
      ["reg_fname"]=&gt; string(1) "a" 
      ["reg_lname"]=&gt; string(3) "asd" 
      ["reg_email"]=&gt; string(5) "ad@ad" 
      ["reg_pass"]=&gt; string(4) "dasd" 
      ["reg_pass2"]=&gt; string(5) "sadsa" 
      ["register_button"]=&gt; string(8) "Register" 
  
  } 
  
  Invalid format 
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>$fname = "";
  $lname = "";
  $em = "";
  $em2 = "";
  $password = "";
  $password2 = "";
  $date = "";
  $error_array = "";
  
  if (isset($_POST['register_button'])) {
  
      $fname = strip_tags($_POST['reg_fname']);
      $fname = str_replace(' ', ' ', $fname);
      $lname = $_POST['reg_lname'];
      $lname = str_replace(' ', ' ', $lname);
  
      $em = $_POST['reg_email'];
      $em = str_replace(' ', ' ', $em);
  
      $password = strip_tags($_POST['reg_pass']);
      $password2 = strip_tags($_POST['reg_pass2']);
  
      $date = date("Y-m-d");
  
      if(filter_var($em, FILTER_VALIDATE_EMAIL)){
          $em = filter_var($em, FILTER_VALIDATE_EMAIL);
  
          $e_check = mysqli_query($con, "SELECT email FROM users WHERE email='$em");
  
          $num_rows = mysqli_num_rows($e_check);
  
          if(num_rows &gt; 0){
              echo "Email already in use";
          }
      }else {
          echo "Invalid format";
      }
  
      if(strlen(fname)&gt;25 || strlen(fname)&lt;2 ){
          echo "Your fi";
      }
  }
  </code></pre>
  
  <p></p>
  
  <p></p>
  
  <pre><code>&lt;form method="post" action="index.php"&gt;
  
  &lt;input type = "text" name="reg_fname" placeholder="First Name"       required&gt;
  &lt;br&gt;
  &lt;input type = "text" name="reg_lname" placeholder="Last Name" required&gt;
  &lt;br&gt;
  &lt;input type = "email" name="reg_email" placeholder="Email" required&gt;
  &lt;br&gt;
  &lt;input type = "password" name="reg_pass" placeholder="Password" required&gt;
  &lt;br&gt;
  &lt;input type = "password" name="reg_pass2" placeholder="Confirm Password" required&gt;
  &lt;br&gt;
  &lt;input type = "submit" name="register_button" value="Register"&gt;
  
  &lt;/form&gt;
  </code></pre>