I need to use the GUMP validation class to validate my form data but how to get each field error seperately
How to show up each field error
<?php
if (isset($_POST['submit'])){
require "gump.class.php";
$validator = new GUMP();
$us = $_POST['username'];
$pwd = $_POST['password'];
// Set the data
$_POST = array('username' => $us,'password' => $pwd);
$_POST = $validator->sanitize($_POST);
$rules = array('username' => 'required','password' => 'required|max_len,100|min_len,6');
$filters = array('username' => 'trim|sanitize_string','password' => 'trim|base64_encode');
$_POST = $validator->filter($_POST, $filters);
$validated = $validator->validate($_POST, $rules);
if ($validated === TRUE){
echo "Successful Validation
";
print_r($_POST);
exit;
} else {
echo $validator->get_readable_errors(true);
}
}
?>