Welcome to this GREAT library that helps to validate your forms server-side using validation rules, PHP's inbuilt validation, and sophisticated regular expressions.
We don't store data submitted through the forms on this documentation, we only validate & discard them immediately.
INSTALLATION
COMPOSER
LOCAL
- Download and import the latest release to your project.
- In your project, use the
require
keyword & include the fileValidate.php
- Now with the
use
keyword, link the class to your project and create a new instance of the class by passing in the form id as the first argument and any configuration as the second argument.
HOW TO USE
Create a new instance of the class octavalidate, and pass in the form ID as the first argument, then any configuration as the second argument.
To begin validation, define validation rules for the form fields, then pass in an array of the
validation rules
as the first argument to the validateFields
method, and an array of the form fields
as the second argument. It defaults to the $_POST
array if no value is provided.
The second argument of validateFields
method
could be fields from the $_POST
array or fields from the $_GET
array.
The validate method returns a boolean.
- true means there are no validation errors
- false means there are validation errors
FEATURES
- You have a rich set of validation rules at your disposal.
- You can choose to validate fields from the
$_POST
array or fields from the$_GET
array. - You can validate anything submitted through the form, including uploaded files.
- Validation errors are well grouped based on their form fields.
- You have the ability to prevent a user from submitting certain values through the form
- Form fields are well validated to ensure that only the correct values are allowed