【发布时间】:2010-08-21 19:56:56
【问题描述】:
如果我使用 http://site.com/index.php?page=45 一切看起来都不错(需要的页面加载)。
但是当我通过http://site.com/index.php?page=45' 或http://site.com/index.php?page=45"(在数字后添加引号)页面打印错误:
Unhandled Exception (Debug)
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'
ORDER BY datePub DESC
LIMIT 10' at line 9
SELECT *, date_format(date, '%d') AS day, date_format(date, '%m') AS month, date_format(date, '%Y') AS year FRO...
// and paths to my scripts
对于黑客来说,这就像比萨啤酒。
如何过滤不需要的符号(如引号),这样页面就不会显示我的数据库查询(可能是我自己的错误文本)?
我已关闭错误报告,但它不是解决方案(不能在任何地方使用它)。
【问题讨论】: