PHP code example of simon-ugorji / octavalidate-php
1. Go to this page and download the library: Download simon-ugorji/octavalidate-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
simon-ugorji / octavalidate-php example snippets
use Validate\octaValidate;
$myForm = new octaValidate('FORM_ID', 'CONFIG_OPTIONS');
//equire 'src/Validate.php';
use Validate\octaValidate;
//create new instance
$myForm = new octaValidate('FORM_ID', 'CONFIG_OPTIONS');
//syntax for defining validation rules
$valRules = array(
"FORM_INPUT_NAME" => array(
["RULE_TITLE", "CUSTOM_ERROR_MESSAGE"]
)
);
/* If you don't provide a custom error message,
the script will use the default one available
*/
//define rules for each form input name
$valRules = array(
"uname" => array(
["R", "Your username is