Search This Blog
Popular Posts
- List of KeyAscii in VB6.0
- List of VB Keycode in Visual Basic 6.0
- Enable and Disable Button VB6 code
- Check valid Email Address in PHP code
- Clear Textbox when Onclick HTML Javascript code
- Get the Filename and the extension of Filename Visual Basic 6.0
- Disable Right-Click of Website - HTML code
- Latest Plate Number with barcode in the Philippines
Check valid Email Address in PHP code
function validate_email($email)
{
// Create the syntactical validation regular expression
$regexp = "^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$";
// Presume that the email is invalid
$valid = 0;
// Validate the syntax
if (eregi($regexp, $email))
{
list($username,$domaintld) = split("@",$email);
// Validate the domain
if (getmxrr($domaintld,$mxrecords))
$valid = 1;
} else {
$valid = 0;
}
return $valid;
}