I'm using php and I want to just ask if the function I'm using to sanitize my inputs is good enough from sql injections and other malicious stuff that can happen through an input.
public function test_input($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
Here is the criteria I want you guys to rate me on:
Is it the most efficient way to sanitize a user's input?
Does it sanitize the input good enough from stopping malicious code going into my database?
Also this is just a bonus but if I sanitize a user's input will I need to be sanitizing anything else? I'm already binding the user's parameters before I enter them into the database.