Thursday, November 8, 2007

Form Validation with PHP

Validating forms in PHP


Using validation class from PEAR http://pear.php.net/package/Validate, it's very easy to validate forms. Forms validation is neede in order to protect your website from xss injection, sql injection, email injection. For example if you are expecting an email address in a field, you should validate that field for an email address.

This class validation from PEAR has the following validation methods:
  • number
  • email
  • date
  • string
  • and more
All you have to do is download this validation class from PEAR, and you now can have a safe website by validationg user input. Open downloaded class, and you will see all the methods, with all the parameters required for each validation method.

How to validate form submission in PHP

No comments: