Reputation: 251
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?
Upvotes: 0
Views: 1223
Reputation: 2828
!empty( $text ) && strlen( $text ) > 123 && !preg_match('/(<[a-z]+>)/', $text )
... and so on...
Upvotes: 0
Reputation: 18798
Some things you need to check :
empty values
numbers only
input length
email address
strip html tags
Credit : php-mysql-tutorial.com
Upvotes: 1