What are the best practices for avoid xss attacks in a PHP site
I need to prevent XSS attacks in PHP code, is there nay good and easy library for this?
Security is not a product. It’s a process.
If you rely on a library for security you’re doomed to being attacked one time or another.
Anyway, you could sanitize your inputs with standard php functions (i.e.
There are lots of PHP functions that can assist you in preventing XSS attacks. Take a look at these:
Theres alot of good answers on google, first one I found; http://codeassembly.com/How-to-sanitize-your-php-input/
My main advice would be to consider every input as a direct attack.
So convert to html characters. Add slashes.