function validateFORM(&$errors)
{
    global $n1, $n2, $operator;
    if (!validateRequred($n1)) {
        $errors['number1'][] = 'This field is reqired';
    } elseif (!isNumber($n1)) {
        $errors['number1'][] = 'Invalid input';
    }
    if (!validateRequred($n2)) {
        $errors['number2'][] = 'Invalid input';
    } elseif (!isNumber($n2)) {
        $errors['number2'][] = 'This field is reqired';
    }
}
function validateFORM(&$errors)
{
    global $username, $pass1, $pass2;
    if (!validateRequred($username)) {
        $errors['username'][] = 'This field is requred';
    } elseif (!validateLenght($username, 2, 40)) {
        $errors['username'][] = 'username must be between 2-50 characters';
    }
    if (!validateRequred($pass1)) {
        $errors['pass1'][] = 'password is requred';
    } elseif (!validateLenght($pass1, 5, 40)) {
        $errors['pass1'][] = 'password must be between 5-40 characters';
    } elseif (!checkConfirmPasslord($pass1, $pass2)) {
        $errors['pass2'][] = 'passwords are not equal';
    }
}
function validateForm(&$errors)
{
    global $firstName, $lastName, $day, $month, $year;
    if (!validateRequred($firstName)) {
        $errors['firstNname'][] = 'firs name is reqired';
    } elseif (!validateLenght($firstName, 2, 40)) {
        $errors['firstNname'][] = 'firs name must be between 2-40 characters';
    }
    if (!validateRequred($lastName)) {
        $errors['firstNname'][] = 'last name is reqired';
    } elseif (!validateLenght($lastName, 2, 40)) {
        $errors['lastName'][] = 'last name must be between 2-40 characters';
    }
    if (!validateDay($day)) {
        $errors['day'][] = 'invalida day';
    }
    if (!validateMonth($month)) {
        $errors['month'][] = 'invalida month';
    }
    if (!validateYear($year)) {
        $errors['year'][] = 'invalida year';
    }
}