• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Accept .edu domain on registration

zerocool786

Active Member
I want to accept ".edu" ONLY on user sign-up. I am running Social Engine v3.

Here is the code, which, email check function is done.

PHP:
// THIS FUNCTION CHECKS IF PROVIDED STRING IS AN EMAIL ADDRESS
// INPUT: $email REPRESENTING THE EMAIL ADDRESS TO CHECK
// OUTPUT: TRUE/FALSE DEPENDING ON WHETHER THE EMAIL ADDRESS IS VALIDLY CONSTRUCTED

function is_email_address($email)
{
$regexp = "/^[a-z0-9]+([a-z0-9_\+\\.-]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i";
return (bool) preg_match($regexp, $email);
}

// END is_email_address() FUNCTION
 
Try this
PHP:
function is_edu_email_address($email) 
{ 
$regexp = "/^[a-z0-9]+([a-z0-9_\+\\.-]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[edu]{2,}$/i"; 
return (bool) preg_match($regexp, $email); 
}
 
Back
Top