Slide 14
Slide 14 text
Filtering and Escaping
Validation & Filtering: Checking for and getting
rid of the nasties.
Checking data is of the correct type, eg.
email addresses, postcodes, message text.
Stripping out control characters, fixing multibyte
encoding shenanigans with iconv().
Escaping: Packaging data up for transport.
mysql_real_escape_string() for MySQL strings.
htmlentities($x, ENT_QUOTES, 'UTF-8'); for HTML.
urlencode() for query params.