【发布时间】:2012-05-25 15:28:52
【问题描述】:
我正在阅读Does $_SESSION['username'] need to be escaped before getting into an SQL query?,它说“您需要转义传递给 sql 查询的每个字符串,无论其来源如何”。现在我知道这样的事情真的很基本。谷歌搜索出现了超过 20,000 个结果。仅 Stackoverflow 就有 20 页的结果,但没有人真正解释什么是转义字符串或如何进行转义。这只是假设。你能帮助我吗?我想学习,因为我一如既往地使用 PHP 制作 Web 应用程序。
我看过: Inserting Escape Characters, What are all the escape characters in Java?, Cant escape a string with addcslashes(), Escape character, what does mysql_real_escape_string() really do?, How can i escape double quotes from a string in php?, MySQL_real_escape_string not adding slashes?, remove escape sequences from string in php 我可以继续说下去,但我相信你明白了。这不是懒惰。
【问题讨论】:
-
PS 我本来可以问一个朋友而不是自欺欺人,但我想会有很多人和我一样想知道每个人都在谈论的东西是什么。
标签: php mysql security escaping