我已经开始使用魔术引号,但遇到了一个小问题,我想这是一个我想不通的简单问题。
我不想使用当我在我的文本区域中写东西时它不会删除的条纹
代码:
<?php
echo "Removed Slashes: ";
// Remove those slashes
if(get_magic_quotes_gpc())
echo stripslashes($_POST['question']);
else
echo $_POST['question'];
?>
<form method='post'>
Question: <input type='text' name='question'/><br />
<input type='submit'>
</form>
我也试过这个真的有效!:
<?php
$str = "Is your name O\'reilly?";
// Outputs: Is your name O'reilly?
echo stripslashes($str);
?>
但现在出于安全原因,我想将我的输入用于网站