Welcome Guest, Not a member yet? Register   Sign In
Form Validation (extentions) Greater than / Less than a curtain number
#4

[eluser]Kiddo[/eluser]
dunno if anyone modified it yet or not, but i changed the greater and less_than validation with this:

function greater_than($str, $field)
{
if ( ! is_numeric($str))
{
return FALSE;
}
if ( ! is_numeric($field))
{
$min = $_POST[$field];
}
else $min = $field;
return $str > $min;
}

the logic is captured by function matches. i modified it cause i'm comparing some number with other number in 2 inputs field. Tongue. by doing this, i can validating my own number or from input field.

regards,
Kiddo


Messages In This Thread
Form Validation (extentions) Greater than / Less than a curtain number - by El Forum - 07-15-2011, 06:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB