title: secure email form, header injection query
body: <p>I'm using the following to clean up input from my contact form:</p>
  
  <pre><code>&lt;?php
  $name = strip_tags(stripslashes($_POST['name']));
  //this is repeated for several other fields, then:
  
  if(isInjected($name)) { die(); }
  /* see isInjected function below */
  
  // send the mail
  ?&gt;
  </code></pre>
  
  <p>I'm using this function:</p>
  
  <pre><code>&lt;?php
      /* function from http://phpsense.com/php/php-mail.html */
      function isInjected($str) {
          $injections = array('(\n+)',
          '(\r+)',
          '(\t+)',
          '(%0A+)',
          '(%0D+)',
          '(%08+)',
          '(%09+)'
          );
          $inject = join('|', $injections);
          $inject = "/$inject/i";
          if(preg_match($inject,$str)) {
              return true;
          }
          else {
              return false;
          }
      }
  ?&gt;
  </code></pre>
  
  <p>Is this sufficient to clean up my contact form?</p>
  
  <p>thanks.</p>