You are developing a web application where users can submit comments. Which of the following techniques would you implement to ensure that malicious scripts aren't executed when other users view the comments?
- Input Validation and Sanitization
- Server-Side Rendering (SSR)
- Using Base64 Encoding
- Implementing Captcha Verification
Input Validation and Sanitization are key to preventing Cross-Site Scripting (XSS) attacks. These techniques ensure that user input is thoroughly checked and sanitized to prevent the execution of malicious scripts when displaying comments. SSR, Base64 encoding, and Captcha are useful in other contexts but do not directly prevent XSS.
Loading...
Related Quiz
- You need to close a file in your PHP script after you're done with it. How would you do this?
- The PHP $_SERVER superglobal contains information about headers, paths, and script locations.
- What is an indexed array in PHP?
- The while loop in PHP tests the condition ______ executing the block of code.
- The preg_match() function in PHP returns true if the pattern was found in the string and false otherwise.