<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Charles Ulrich wrote:
<blockquote
 cite="mid:8e690af80805131502h123b1565xad6ded0b93eb35a@mail.gmail.com"
 type="cite">
  <pre wrap="">While we're on the topic of programming, I have a general question for
any PHP coders out there... how do _you_ deal with input sanitation?
  </pre>
</blockquote>
Don't let users type in data. :)<br>
<br>
<blockquote
 cite="mid:8e690af80805131502h123b1565xad6ded0b93eb35a@mail.gmail.com"
 type="cite">
  <pre wrap="">Is there a class or something that makes this straightforward...
  </pre>
</blockquote>
<a class="moz-txt-link-freetext" href="http://www.w3schools.com/PHP/php_filter.asp">http://www.w3schools.com/PHP/php_filter.asp</a> (since 5.1, I believe)<br>
<h2>Functions and Filters</h2>
<p>To filter a variable, use one of the following filter functions:</p>
<ul>
  <li>filter_var() - Filters a single variable with a specified filter</li>
  <li>filter_var_array() - Filter several variables with the same or
different filters</li>
  <li>filter_input - Get one input variable and filter it</li>
  <li>filter_input_array - Get several input variables and filter them
with the same or different filters</li>
</ul>
<br>
<blockquote
 cite="mid:8e690af80805131502h123b1565xad6ded0b93eb35a@mail.gmail.com"
 type="cite">
  <pre wrap="">... or do
you really have to carefully scrutinize every variable and SQL query
because an automated process can never cover every contingency?</pre>
</blockquote>
Well, of COURSE you do. <a class="moz-txt-link-freetext" href="http://xkcd.com/327/">http://xkcd.com/327/</a><br>
<br>
-- Peter Smith<br>
</body>
</html>