Software > PHP Validation

PHP Validation - v2.3.3


The PHP Validation script is a set of validation rules which lets you add server-side validation to your forms quickly and with as little effort as possible. The script checks the values that a user has entered into your form, and if it doesn't meet the criteria specified (e.g. they failed to enter a value, or they entered a fake email address), they are returned to the original form with a list of all the offending fields. It requires PHP 4 or later.

Click on the various links in the box above to get instructions on how to add it to your form, see and view the PHP for a demonstration form and get a list of all available validation rules. The demonstration page contains all the validation options currently offered by the script. Version 2.0 (Dec 2006) includes some additional validation rules (alphanumeric test, improved range and length tests). It is backward compatible with earlier versions. Many thanks to Mihai Ionescu and Nathan Howard for contributing their code. The 2.3.1 release fixes a bug noticed by Khalid Hanif with the reg_exp option. Thanks Khalid!

I've tried to make this script as simple to integrate as possible, but these help pages are included here as a handy reference and starting point.

This script was designed to be identical to the JS Validation code; both employ exactly the same logic and validation rules, so you can simply copy and paste the validation rules from one to the other, providing both client- and server-side validation with very little work!

How to add validation to your form >>