Jump to content

How can I prevent users from entering HTML in a textarea?


Recommended Posts

you could use java script to see if they used anything other then simple text and numbers..

 

so check in to javascript..

 

php needs for you to submit the text so the user can enter it, but it wont work ..but with javascript they can't enter it at all.

  • 2 weeks later...

Don't even bother with the javascript.

Anyone wanting to find exploits is going to have javascript either completely killed, or just block whatever protection you put in it.

 

And on top of that, you will only piss off legitimate users, maybe forcing them to just give up entirely and not try to use the form ever again.

 

Just let PHP remove any bad data. No problems then. :)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.