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

http://www.php.net/manual/en/filter.filters.php


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -