如何保护我的数据库免受黑客攻击 [英] how to secure my database against hackers
本文介绍了如何保护我的数据库免受黑客攻击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
保护我的数据库免受黑客攻击的最佳方法是什么?我使用下面的代码:
<?php
$ sname = mysql_escape_string(trim($ _ POST [' sname'])) ;
$ insert = mysql_query( INSERT INTO user(sname)VALUES( SNAME)跨度>);
if ($ insert){
echo success;
}
else {
echo not successful;
}
?>
< br $> b $ b
这足以保护我的数据库吗?
解决方案
sname = mysql_escape_string(trim(
_POST [' sname']));
insert = mysql_query( INSERT INTO user(sname)VALUES(sname) );
if (
What is the best way of securing my database against hackers. I use this code below:
<?php
$sname=mysql_escape_string(trim($_POST['sname']));
$insert=mysql_query("INSERT INTO user(sname) VALUES(sname)");
if ($insert){
echo "success";
}
else{
echo "not successful";
}
?>
Will this be enough to secure my database?
解决方案
sname=mysql_escape_string(trim(
_POST['sname']));
insert=mysql_query("INSERT INTO user(sname) VALUES(sname)"); if (
这篇关于如何保护我的数据库免受黑客攻击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文