我在我的web应用程序中创建了一个只有单个文本字段的表单,并且该字段使用GET发布到PHP页面,但我正在观察奇怪的行为。即当我在我的本地服务器上测试它时,收到的文本是在文本字段中写入的,但是当我将它上载到我的在线服务器时,收到的字符串会自动转义,意味着所有单引号和双引号都会被转义。例如如果我写It's not true...
然后在PHP端我会得到PHP转义查询字符串变量
$comment = $_REQUEST["comm"];
print $comment;
//will print It\'s not true... on my online server
//will print It's not true... on my local server
我还不能下架,为什么会这样呢?是否有任何PHP设置自动转义查询字符串变量?
@Ummar很高兴帮助。 – AgentConundrum 2011-04-07 05:32:14