【发布时间】:2013-04-28 17:26:53
【问题描述】:
我在将输入保存到我的数据库时遇到问题。
我将字符串保存到我的数据库中:
mysql_real_escape_string($my_string)
然后,我阅读并将字符串放入输入中:
stripslashes($my_string)
关键是,如果我在字符串中设置双斜杠,输入会像这样崩溃:
<input maxlength = "150" type="text" name = "my_string12" value = "hello "this is" a test" class="input-medium"/>
谢谢。
【问题讨论】:
-
应该可以。但我不能告诉我的用户使用单引号而不是双斜杠...