im trying to make a little forum type thing. so how would i do the comments that no can throw html in there?
thanks in advance =)
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.
Simplest way, is to replace
<with<and>with>then insert the post into the database.That’s the basic starting point, you can whitelist certain tags and expand on it later but this will protect you against just about every HTML injection.
Alternatively, you can use some kind of HTML encode function to sanitise input.