https://github.com/refkinscallv/fvss
PHP Form Validation Server-Side
https://github.com/refkinscallv/fvss
form-validation php php-library request-validator validation-library validation-tool
Last synced: 12 months ago
JSON representation
PHP Form Validation Server-Side
- Host: GitHub
- URL: https://github.com/refkinscallv/fvss
- Owner: refkinscallv
- License: mit
- Created: 2024-01-13T20:20:29.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-28T21:03:19.000Z (almost 2 years ago)
- Last Synced: 2025-04-10T00:57:22.932Z (12 months ago)
- Topics: form-validation, php, php-library, request-validator, validation-library, validation-tool
- Language: PHP
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# FVSS - Form Validation Server-Side for PHP
FVSS (Form Validation Server-Side) is a PHP library designed to streamline and simplify the process of server-side form validation. It offers a comprehensive set of validation functions catering to common input data types found in web forms. FVSS ensures that the data submitted by users adheres to predefined criteria, enhancing the security and reliability of form submissions.
## Features
- **Validation Types:**
- `alphanum` (Alphabet & Numeric Format)
- `alpha` (Alphabet Format)
- `num` (Numeric Format)
- `date` (Date Format)
- `datetime` (Date & Time Format)
- `time` (Time Format)
- `email` (Email Format)
- `url` (URL Format)
- `domain` (Domain Format)
- `ip` (IP Format)
- **Additional Parameters:**
- `space`: Allowing or disallowing spaces in the values.
- `length`: Specifying the minimum length for certain types of validation.
- `punct`: Allowing or disallowing punctuation marks in the values.
## Installation
Install FVSS using Composer:
```bash
composer require refkinscallv/fvss
```
## Usage Example
```php
"Jhon Doe",
"label" => "Name",
"type" => "alpha",
"length" => false,
"space" => true,
"punct" => false,
], [
"value" => "0888888888",
"label" => "Phone Number",
"type" => "num",
"length" => 10, // minimum length
"space" => false,
"punct" => false,
], [
"value" => "2000-02-09",
"label" => "Date of Birth",
"type" => "date",
"length" => false,
"space" => false,
"punct" => false,
], [
"value" => "mail@mail.com",
"label" => "Email",
"type" => "email",
"length" => false,
"space" => false,
"punct" => false,
], [
"value" => "https://www.facebook.com",
"label" => "Social Media URL",
"type" => "url",
"length" => false,
"space" => false,
"punct" => false,
]
];
// Validation process
$validate = $fvss->validate($req);
// Output of the validation process is a boolean: true or false
// If the output is false, then the $validate->message object variable will have the value of the error message
if ($validate->status) {
echo "So far so good";
} else {
echo $validate->message;
}
```