What does whitelisting involve for inputs to prevent html and xss injection?
From what I gather preg_replace with regular expression is a good start. What else?
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.
It is easier to sanitize output than input. Apply the correct escaping every time your data passes from one context to the next. For example, apply mysqli_real_escape_string when data is passed to the database (if you are using the MySQLi extension), apply htmlspecialchars when you output the data as HTML and so on.