title: Why is my php code bypassing a few if statements?
body: <p>As I was working with my program, I had come up with an unknown error. What happens is that my code is bypassing two <code>if</code> statements. Here's my code:</p>
  
  <pre><code>&lt;?
  session_start();
  if ($_POST){
    $ao = trim($_POST['amountof']);
    $continue = true;
    if (strlen($ao) &lt; 1){  ####First If-Statement Bypassed####
      $continue = false;
      $_SESSION['error'] = "Please enter in a value!";
    }
    if (strlen($ao) &gt; 20){  ####Second If-Statement Bypassed####
      $continue = false;
      $_SESSION['error'] = "Your value has exceeded 20!";
    }
    if (!is_numeric($ao)){
      $continue = false;
      $_SESSION['error'] = "Value is not numeric!";
    }
  }
  
  ?&gt;
  &lt;form method="post"&gt;
  &lt;?
  if (isset($_SESSION['error'])){
    print "&lt;span style=\"color: red; font-weight: bold;\"&gt;" . $_SESSION['error'] . "                &lt;/span&gt;&lt;br /&gt;";
  }
  ?&gt;
  How many letters are you planning to process?&lt;br /&gt;
  &lt;span style="font-size:.8em; color: grey;"&gt;You may not exceed 20&lt;/span&gt;&lt;br /&gt;
  &lt;input type="text" name="amountof" style="width:25px;" maxlength="2"/&gt;
  &lt;input type="submit" value="Continue" /&gt;
  &lt;/form&gt;
  
  &lt;? unset($_SESSION['error']); ?&gt;
  </code></pre>
  
  <p>The if statements that are bypassed are marked in the code.
  Thank you!</p>