I'm receiving data from a form in php via get.
I am handling the information as follows:
$search = mysql_real_escape_string(htmlspecialchars($_GET["t"], ENT_QUOTES, 'UTF-8'));
With this I intend to block attacks by javascript and sql-injection.
The questions are:
- Is it the best way to block these two types of attacks?
- htmlspecialchars could somehow negate the effectiveness of the mysql_real_escape_string function?
I have read a lot of topics about these subjects, but each one says one thing and it is not always possible to check whether the information is reliable or not.