模拟sql注入,为啥没成功?
<form action="" method="post">
<input type='text' name='text'>
<input type='submit' value='tj'>
</form>
</body>
</html>
<?php
if($_POST){
$text = $_POST['text'];
$sql="INSERT INTO aa (cate) VALUES ('" . $text . "')";
mysql_query($sql);
}
?>
我验证了代码没有问题,也打印出了sql语句
INSERT INTO aa (cate) VALUES ('value'); DROP TABLE aa;--')
也确认了php.ini 的magic_quotes_gpc = Off
但是表aa还是完好的在库里。为什么?
sendoh
9 years, 11 months ago