如何在我的网站中防止XSS注入


How can I prevent an XSS injection in my website?

可能重复:
如何用HTML/PHP防止XSS?

我知道在很多网站上,如果你输入:
<script>alert("xss");</script>
网站将显示一个错误
示例:http://www.igossips.com

在搜索框中输入前面的代码
网站上显示了很多代码。

如何防止这种情况在我自己的网站上发生??

以下是XSS预防的一个很好的概述:

https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet