ello There, i want to ask, how can i customize this function to allow only certain email domain.
like for instance A & B wants to register,
A email = test@ymail.com
B email = test@onlyalloweddomain.com
how can i validate that?
here's my function
function validate_values() {
// Create the array which contains the Language variable
$error = array();
// Define the Language variable for each type of error
if($this->verify_if_user_exist() !== 0) {
$error[] .= 'user_exists';
}
if($this->verify_if_email_exists() !== 0) {
$error[] .= 'email_exists';
}
if(empty($this->username) && empty($this->password) && empty($email)) {
$error[] .= 'all_fields';
}
if(strlen($this->password) <= 2) {
$error[] .= 'password_too_short';
}
if(!ctype_alnum($this->username)) {
$error[] .= 'user_alnum';
}
if(strlen($this->username) <= 2 || strlen($this->username) >= 33) {
$error[] .= 'user_too_short';
}
if(!filter_var($this->email, FILTER_VALIDATE_EMAIL)) {
$error[] .= 'invalid_email';
}
if($this->verify_captcha() == false) {
$error[] .= 'invalid_captcha';
}
return $error;
}
THANKS!!