mysqli - Can anyone or hacker delete my database table/row/column without knowing my database username and password in php-mysql? -
this question has answer here:
- how can prevent sql injection in php? 28 answers
i want know how protect website hacker. php-mysql developer. fetching data database use mysqli. prevent website sql injection use $db->real_esacpe_string() function of php. prevent website xss(cross site scripting) used function
function parsing($text) { global $db; $text=$db->real_escape_string($text); $text= @trim($text); $text= strip_tags($text); if(get_magic_quotes_gpc()) { $text= stripslashes($text); } $text=str_replace('<','',$text); $text=str_replace('>','',$text); $text=htmlspecialchars($text, ent_quotes, 'utf-8'); return($text); } $name=parsing($_post['name']); any suggestion side welcomed. in advance.
with of done don't think hacker can delete or access database.
but there many other techniques hacker can use in hacking website.
like
- ddos
- xss
- session hyjacking etc
which there different ways of protecting website against them.
Comments
Post a Comment