I'm looking a for generic way of handling the user input for security. I'm using something Like :
$a = trim(stripSlashes(htmlentities($_POST['a'])))
is there any better or more secured way?
Thanks
it depends what your trying to protect against.
if your trying to protect against html and javascript, then htmlentities() works good for that in most cases.
if your trying to protect against sql injection, use mysql_real_escape_string()