title: Which functions are needed for secure form inputs?
body: <p>On my registration form I have four inputs:  </p>
  
  <pre><code>username  
  password
  email address
  web address
  </code></pre>
  
  <p>Can't figure which off all available sanitizing  methods is really needed:  </p>
  
  <pre><code>strip_tags()
  substr()
  mysql_real_escape_string()
  trim()
  htmlentities()
  addslashes()
  . . . (you may add more)
  </code></pre>
  
  <p>Somewhere I found that a function is a <code>must have</code>, somewhere this function is declared as <code>deprecated</code> or <code>less valuable the another one ...</code>  </p>
  
  <p>Could someone be so kind to create a list of priorities for all four inputs above.  </p>
  
  <p>Note: <code>PDO - prepared statements</code> are already used for communication with database.</p>