Jump to content

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


mesh2005

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. :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.