Validating forms using php
Most of cases we will use the * symbol for required field.Validation means check the input submitted by the user.For example, if you have set length limit in the database for a text input, it is better to do the validation before it actually gets cut off by the database system or even getting an error thrown.
Client-side form validations help in giving immediate feedback to the user.
We create and associate a set of “validation descriptors” with each element in the form.
The “validation descriptor” is a string specifying the type of validation to be performed.
When there are many fields in the form, the PHP validation script becomes too complex.
Moreover, since you are doing the same or similar validation for most of the forms that you make, just too much of duplicate effort is spent on form validations.