Hi How do you think if I define a function like this: function m($variable){ $variable=addslashes($variable); $variable=strip_tags($variable); $variable=mysql_real_scape_string($variable); return $variable; }
You don't need addslashes() if you're already using mysql_real_escape_string(). And maybe you want to use trim() as well. Aaaand I would use htmlsecialchars() instead of strip_tags()... but that's just me. It also depends on what you want to do with the variable.