tags:

views:

54

answers:

2

I have lot of textarea fields to add comments and quotes. How can I validate these fields. I checked null validation other than null validation what validation I have to do?

+1  A: 

Some things you need to check :

  • empty values

  • numbers only

  • input length

  • email address

  • strip html tags

Credit : php-mysql-tutorial.com

Babiker
A: 
!empty( $text ) && strlen( $text ) > 123 && !preg_match('/(<[a-z]+>)/', $text )

... and so on...

Tobias