I want security against hackers for my mysql connection in a php page.
I have database user's password different from the root password. And I've used this query:
function make_safe2($safe)
{
$safe = strip_tags(mysqli_real_escape_string(trim($_POST['bname'] . $_POST['why'] . $_POST['email'] . $_POST['submit'])));
return $safe;
}
Is there any more ways by which I can assure security against SQL injections and other hacking methods. I don't have any login page. I have a form with bname, why and email fields and a submit button. Does submit button needs escape string? :P Silly question I guess.
A complete syntax for other ways of preventions from SQL injections and other methods will be appreciated. :)