Reputation: 160
Is there a way to remove or not allow to put Html tags in a textarea?
I have a form that send email with a textarea where user put comments.
But I got some spammers, putting html code in the textarea, which appear a form of html when the mail is send.
How can I convince that?
Upvotes: 1
Views: 11410
Reputation: 943207
It sounds like you are taking input that is supposed to be text, but are treating it as HTML (by injecting it, unchanged, in an HTML document).
Pass the data through htmlspecialchars
to create an HTML representation of the entered text (before adding it to the HTML document).
Upvotes: 0