Filter Input
(Chapter 1, Introduction - Pg 11)
<?php
$clean = array();
switch($_POST['color'])
{
case 'red':
case 'green':
case 'blue':
$clean['color'] = $_POST['color'];
break;
}
if (ctype_alnum($_POST['username']))
{
$clean['username'] = $_POST['username'];
}
?>