Download the PHP package jasonsarino/php-formvalidator without Composer
On this page you can find all versions of the php package jasonsarino/php-formvalidator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package php-formvalidator
PHP Formvalidator
This library use to validate and sanitize form entry with sanitization to avoid sql injection and easy to set rules for specific fields.
Install
Requires PHP 7.1 or newer.
Usage
Include Sanitizer and FormValidator Class
Fetch data from $_POST form
assume that we have data from $_POST data
Reset data array for multiple form entries
(Optional) Use to reset array to FormValidator class f you have multple form entries
Set and Hold $_POST into data array variable
Set Rules ro fields
Validate data array variable with rules
Get the result from validateData method
return bolean
Display Error
Complete Usage
Rule Reference
The following is a list of all the native rules that are available to use:
Rule | Parameter | Description | Example |
---|---|---|---|
required | No | Returns FALSE if the form element is empty. | |
alpha | No | Returns FALSE if the form element contains anything other than alphabetical characters. | |
alphaS | No | Returns FALSE if the form element contains anything other than alpha characters or spaces. Should be used after trim to avoid spaces at the beginning or end. | |
alphaNum | No | Returns FALSE if the form element contains anything other than alpha-numeric characters. | |
alphaNumS | No | Returns FALSE if the form element contains anything other than alpha-numeric characters or spaces. Should be used after trim to avoid spaces at the beginning or end. | |
alphaNumSymbol | No | Returns FALSE if the form element contains anything other than alpha-numeric-symbol characters. Should be used after trim to avoid spaces at the beginning or end. | |
alphaNumSymbolS | No | Returns FALSE if the form element contains anything other than alpha-numeric-symbol characters or spaces. Should be used after trim to avoid spaces at the beginning or end. | |
dateFormat | No | Returns FALSE if the form element contains anything other than date format. | |
dateTimeFormat | No | Returns FALSE if the form element contains anything other than date and time format. | |
No | Returns FALSE if the form element does not contain a valid email address. | ||
ipAddress | No | Returns FALSE if the supplied IP address is not valid. Accepts an optional parameter of ‘ipv4’ or ‘ipv6’ to specify an IP format. | |
maxLen | Yes | Returns FALSE if the form element is longer than the parameter value. | maxLen[12] |
num | No | Returns FALSE if the form element contains anything other than numeric characters. | |
numS | No | Returns FALSE if the form element contains anything other than numeric and space characters. | |
float | No | Returns FALSE if the form element contains anything other than a float number. | |
regxp | Yes | Returns FALSE if the form element not meet a particular regular expression. | regxp[/^[0-9a-zA-Z ]+$/] |
All versions of php-formvalidator with dependencies
PHP Build Version
Package Version
No informations.
The package jasonsarino/php-formvalidator contains the following files
Loading the files please wait ....