Home » Archive by category 'Quick Tip'


— Preventing Cross-Site Scripting – PHP #QuickTip

You want to securely display user-entered data on an HTML page. For example, you want to allow users to add comments to a blog post without worrying that HTML or JavaScript in a comment will cause problems.
For this you can pass user input through htmlentities(  ) before displaying it.