Well, I know that “correct” escaping will help to prevent SQL injection.
But I saw people escaping values in HTML
<input type="text" value =/"some/" /> <!-- some escaped, why? -->
Question is:
Why to escape in HTML?
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.
That is a syntax error. Don’t do that.
Use character references to represent special characters (
&,<, etc).(Assuming you use the correct syntax to do so): because some characters have special meaning in HTML. For example, you don’t want a
"(in the data) ending your attribute value prematurely since that can: