[英]Is it safe to use mysql_real_escape_string() for user inputs
Recently I am developing little question generation program on PHP. 最近,我正在开发PHP上的小问题生成程序。 It uses some LaTeX formatted math formulas.
它使用一些LaTeX格式的数学公式。
I've described this issue here : 我在这里描述了这个问题:
Backslashes are auto-removed while inserting LaTeX formulas to MySQL with PHP 使用PHP将LaTeX公式插入MySQL时,反斜杠会自动删除
I found a solution by using mysql_real_escape_string(). 我通过使用mysql_real_escape_string()找到了解决方案。 But this arises another question.
但这引起了另一个问题。
通常,此功能是专门为清除用户输入而设计的,并且应始终按照文档使用: http : //php.net/manual/en/function.mysql-real-escape-string.php
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.