这是我的代码:
网址:
http://www.mysite.com/t.php?title=The%20Police%20-%20Don't%20Stand%20So%20Close%20to%20Me%20'86%20-
PHP:
<?php if(!empty($_GET['title'])){ >
<form method="post" action="t.php?done=yes" enctype="multipart/form-data">
<input type="text" name="title"
<?php echo "value=\"".htmlspecialchars($_GET['title'])."\""; ?>
>
<input name="submit" value="Submit" type="submit" />
</form>
<?php } >
<?php if(!empty($_POST['title'])){
echo mysql_real_escape_string($_POST['title']);
// I have to put the string in a database ( I haven't added that part )
} >
如果我按照第一个 URL 然后提交表单,我会得到这个字符串:
The Police - Don\\\'t Stand So Close to Me \\\'86 -
代替:
The Police - Don't Stand So Close to Me '86 -
为什么 ?我怎样才能得到最后一个字符串?
谢谢
.
编辑:
我刚刚发现 magic_quotes_gpc 为 ON,因为 get_magic_quotes_gpc() 返回 TRUE。