Hi All,
I was trying to write a function able to sanitise user input, to be used in a registration form.
So far I came up with the following:
if(isset($_POST['submit'])){
// strip malicious code
if(get_magic_quotes_gpc()) {
$_POST = array_map('stripslashes', $_POST);
}
$_POST = array_map('trim', $_POST);
$_POST = array_map('mysql_real_escape_string', $_POST);
$_POST = array_map('strip_tags', $_POST);
This is supposed to sanitise all fields in the $_POST variable, but I'm sure I'm forgetting something else. can you please advise?
Thanks
Patrick