Forum Moderators: coopster

Message Too Old, No Replies

Is htmlentities Function Enough For Verifying Form Fields?

         

BlackRaven

7:06 pm on Dec 21, 2005 (gmt 0)

10+ Year Member



what do you guys use in combination with htmlentities()?

jatar_k

7:09 pm on Dec 21, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



also always test that the value is

of the expected type
of expected length

coopster

10:10 pm on Dec 21, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I don't use htmlentities() for verifying form fields, but I do use it when I write any field values out to a form. If the data being used is user-supplied, make certain you follow jk's advice here and validate it.

jatar_k

10:20 pm on Dec 21, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I will also add

make sure it doesn't contain anything unwanted, which may go beyond type testing