I am trying to make my php scripts more secure.
Because i got a form with alot of post variables I don't want to check each variable.
On stackoverflow i found this script at a post but it had a score of -2 so i think this isn't secure but i cant find any reason why it woudln't be secure
foreach($_POST as $key => $value)
{
$value = filter_var($value, FILTER_SANITIZE_STRING);
$value = mysql_real_escape_string($value);
$_POST[$key] = $value ;
}
Is this script secure to make the $_POST
variables safe ?
edit Safe to use in a sql statement