为什么每次提交表单后 htmlspecialchars() 不能连续编码字符?看看下面的例子:
<?php $_POST['txt'] = htmlspecialchars($_POST['txt']); ?>
<form method="post">
<input name="txt" value="<?=$_POST['txt'] ?>" />
<input type="submit" name="save" value="test" />
</form>
您可以在http://verticalcms.com/htmlspecialchars.php运行时看到它。
现在执行以下操作
1) Type & into the text field
2) Hit the test button once
3) When the page completes post back, hit the test button again
4) When the page completes post back, view the page source code
在输入框中,值为&
我期待& 放大器;
为什么不是& 放大器;???