Don't forget some xss cleaning functions
Code:
// Prep user input for storage - XSS cleanup
function xss_input($input) {
$input = trim($input);
if (!get_magic_quotes_gpc()) {
return addslashes($input);
}
return $input;
}
// Prep user inputed data for viewing in html page, textbox, or textarea
function xss_output($output) {
$output = stripslashes($output);
return htmlspecialchars($output);
}