Hello please someone tell how to prevent hack using sql db injection ...
Thank's
Hello please someone tell how to prevent hack using sql db injection ...
Thank's
Use an escape PHP function on website, forum, anything connected to the database.
How to use it:Code:function escape($Data) { return str_replace(array("'", '"', "#", "--", "/*", ";", "UPDATE", "DROP", "DELETE"), "", $Data); }
Note: This must be used on input types. It's useless to use it on all variables.Code:$username = escape($_POST[username]); $password = escape(md5($_POST[password])); //and so on...
You can use this one, optimize it for your current "infraction" queries.
Or simply use PDO.