php端在接收用户输入的时候,应该过滤掉html标签。
比如使用下面的方法:
preg_replace("/<(.*?)>/","", $str);
或者使用 htmlspecialchars()函数进行转义。转成
<script>alert('aaa');</script>