PHP in HindiProgramming Language

PHP Pre-made Validation System For Your Project

Project:- PHP Pre-made Validation System For Your Project

If you are looking for validation system for your project you are on right place. Check the rule list and example below. Download Validation system from github with command and by visiting on github.

Rule List

//========================================================================// 
//================================ Rule List==============================// 
//========================================================================//

    1. required
    2. string
    3. int
    4. max:value
    5. min:value

Basic Example

<?php

require 'Validator.php';
$rules = array(
    'name' => 'required|min:10',
    'address' => 'required'
);
if (isset($_POST['submit'])) {
    $validation = new Validator($_POST, $rules);
    foreach ($validation->getErrors() as $error) {
        echo "<li>" . $error . "</li>";
    }
    if ($validation->pass()) {
        echo "Form Suuccess";
    }
}
?>


<form method="post" action="">
    <!-- name field-->
    <label for="name">Name</label>
    <input id="name" type="text" name="name">
    <!-- address field -->
    <label for="address">Address</label>
    <input id="address" type="text" name="address">
    <!-- nicname field we not check validatio just for demo purpose-->
    <label for="address">Nick Name</label>
    <input id="address" type="text" name="nick_name">

    <input type="submit" value="Submit" name="submit">
</form>

Download Validation System

By Git Clone Command

git clone https://github.com/kkhicher1/validation-oop-class.git

By Visiting on github

Click Here to Download Project By visit on Github

Other Important Topics

Final Word

If you want we update some new rule please comment below.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button
Close