title: where should I put filter_var ($ email_address, FILTER_VALIDATE_EMAIL)?
body: <p>I do not get it where should I put <code>filter_var ($ email_address, FILTER_VALIDATE_EMAIL)</code> in this code?</p>
  
  <pre><code>$hiddenfield = md5("d-m-Y-l");
  $passwordhash = '%_&amp;!KJ:FLA)809-25j;LKJF:LKJAP*^@)';
  $ww = hash('SHA512', md5(sha1('Test' . $passwordhash)));
  if (isset($_POST['register'])) {
    if (isset($_POST['hiddenfield']) == $hiddenfield) {
      if (isset($_POST['username']) &amp;&amp; isset($_POST['email']) &amp;&amp; isset($_POST['password']) &amp;&amp; isset($_POST['password2'])) {
        if (strlen($_POST['username']) &gt;= 3) {
          $email = $db-&gt;escape_string($_POST['email']);
          if ($selectemail = $db-&gt;query("SELECT * FROM gebruikers WHERE email='$email'")) {
            if ($selectemail-&gt;num_rows == 0) {
          $ww1 = $db-&gt;escape_string($_POST['password']);
          $ww2 = $db-&gt;escape_string($_POST['password2']);
          if ($ww1 == $ww2) {
            if (strlen($ww1) &gt;= 6) {
              $ip = $db-&gt;escape_string($_SERVER['REMOTE_ADDR']);
              if ($ipc = $db-&gt;query("SELECT * FROM gebruikers WHERE ip='$ip'")) {
                if ($ipc-&gt;num_rows &lt; 3) {
                  $username = $db-&gt;escape_string(htmlentities($_POST['username']));
                  $passwordQ = $_POST['password'];
                  $password = $db-&gt;escape_string(hash('SHA512' , md5(sha1($passwordQ . $passwordhash))));
                  $email = $db-&gt;escape_string($_POST['email']);
                  $forgot_idf = substr(str_shuffle(str_repeat("0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&amp;*()-ABCDEFGHIJKLMNOPQRSTUVWXYZ?&gt;&lt;`~", 5)), 0, 25);
                  $active_code = $db-&gt;escape_string(md5($forgot_idf));
                  $register_on = date("F Y");
                  if ($insertregister = $db-&gt;query("INSERT INTO gebruikers (username, password, rankid, register_on, active, active_code, email, ip) VALUES ('$username','$password','1','$register_on', '0', '$active_code', '$email', '$ip')")) {
                   $error2 = 'Account is created!';
                  } else {
                    echo 'Query is incorrect! ' . $db-&gt;error;
                  }
                } else {
                  $error = 'You have already registered more than 3 accounts!';
                }
              }
            } else {
  
               $error = 'Your password must be at least 6 characters!';
            }
          } else {
  
             $error = 'The passwords do not match!';
          }
          } else {
  
              $error = 'This email address has been used once before!';
            }
          } else {
            echo 'Query is incorrect! ' . $db-&gt;error;
          }
        } else {
  
          $error = 'Your username must contain at least 3 letters!';
  
        }
      }
    }
  }
  </code></pre>
  
  <p>I've already tried everything.
  can somebody for me add <code>filter_var ($ email_address, FILTER_VALIDATE_EMAIL)</code>?</p>