Does this depend on if the input is going to be printed to the user? In my case I need to return the input back to the user (comments and bio).
Thanks!!!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
htmlspecialchars()is enough to prevent XSS.Strip tags removes tags but not special characters like
"or', so if you usestrip_tags()you also have to usehtmlspecialchars().If you want users’ comments to be displayed like they typed them, don’t use strip_tags, use htmlspecialchars() only.