Can I use these PHP functions together? -
can use these php functions below:
$user = mysql_escape_string($user); $user = filter_var($user, filter_sanitize_string); $user = stripslashes($user); $user = trim($user);
together this:
$user = mysql_escape_string(stripslashes(trim(filter_var($user, filter_sanitize_string))));
sorry if stupid question.
var_filter validate or sanitize var according list of predefined filters: filter_validate_email, filter_sanitize_email, filter_validate_url, filter_sanitize_url.
trim , stripslashes old school way sanitize vars
mysql_escape_string sanitize querys mysql, therefore function deprecated, must use mysql_real_escape_string, syntax identical.
var_filter elegant , have many options trim , stripslashes
Comments
Post a Comment