I am looking for the best MySQL Post Injection proofing control.
Currently I use
function inputclean($data) {
// Strip all HTML from the input
$data = strip_tags($data);
// Stripslashes
if (get_magic_quotes_gpc()) {
$data = stripslashes($data);
}
// Quote if not a number or a numeric string
if (!is_numeric($data)) {
$data = "'" . mysql_escape_string($data) . "'";
}
return $data;
}
I know there are better more secure ways of checking input just difficult to know what function to use?
Any help would be great.
Thanks