- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
// Validate numeric field
public function validateNumber($field, $errorMessage, $min=2, $max=32){
if(!isset($_REQUEST[$field]) || !is_numeric($_REQUEST[$field])
|| strlen($_REQUEST[$field])<$min
|| strlen($_REQUEST[$field])>$max)
{
$this->errors[]=str_replace('<br>', '', $errorMessage) . '<br>';
}
}