Recommend this page to a friend! |
Classes of Ravi Kumar | PHP Validator | README.md | Download |
|
|
![]() PHP ValidatorValidator class to validate form post values in a simple way. Usage
Rules* __required__: Returns FALSE if the form element is empty. * __minlength__: Returns FALSE if the form element is shorter then the parameter value. minlength=>6 * __maxlength__: Returns FALSE if the form element is longer then the parameter value. maxlength=>10 * __email__: Returns FALSE if the form element does not contain a valid email address. * __activeemail__: Returns FALSE if the form element does not contain a valid and active email address. * __url__: Returns FALSE if the form element does not contain a valid url address. * __activeurl__: Returns FALSE if the form element does not contain a valid and active url address. * __ip__: Returns FALSE if the supplied IP is not valid. * __alpha__: Returns FALSE if the form element contains anything other than alphabetical characters. * __alphaupper__: Returns FALSE if the form element contains anything other than upper alphabetical characters. * __alphalower__: Returns FALSE if the form element contains anything other than lower alphabetical characters. * __alphadash__: Returns FALSE if the form element contains anything other than alpha-numeric characters, underscores or dashes. * __alphanum__: Returns FALSE if the form element contains anything other than alpha-numeric characters. * __hexadecimal__: Returns FALSE if the form element contains anything other than hexadecimal characters. * __numeric__: Returns FALSE if the form element contains anything other than numeric characters. * __matches__: Returns FALSE if the form element does not match the one in the parameter. matches[form_item] * __unique__: Returns FALSE if the form element is not unique to the table and field name in the parameter. unique[field] Based on Alex Garrett work http://bit.ly/1oO8Yxn LicenseReleased under the MIT license<br> Copyright (c) 2014 Ravi Kumar |