How do I make sure no one can enter a script in a comment box?
For now I have put a htmlspecialchars()
so that scripts can not be easily entered but, of course, with the person in question to find out that you can write html characters all you have to do is insert a script with those characters.
I thought about doing a preg_replace()
to the characters <
and >
but then I have fallen in that the only thing that the user should do to skip that filter is to take advantage of the tag for links to put the script inside.
So, how do I do it so the user can not put a script in the comments box anyway?