Verify malformed e-mail address format php script
Script Description:
Verify e-mail address format and the existence of its domain.
Cut-and-paste php code:
Note: It is class library.
<?php //=================================================================== // What: EmailClass // Where: www.ComputationalNeuralSystems.com // Copyright (C) 2003 ComputationalNeuralSystems.com //=================================================================== //=================================================================== // What: Check for malformed e-mail address field // How: Parse for valid alphanumeric user-name separated by '@' // followed by alphanumeric host-name plus '.' // plus alphanumeric global-domain-name // Note: It DOES NOT check for EXISTENCE of domain name. // return: (boolean) e-mail format is valid //=================================================================== function EmailAddressFormatIsValid($the_email_address) { return (eregi ("^([a-z0-9_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]+$", $the_email_address)); //case insensitive check for string pattern } ?>
Here is what it does:
Disabled to protect privacy of individual's email address
Tutorial of how the code works:
Run-time logic:
check for malformed email address field by invoking EmailAddressFormatIsValid($the_email_address)
Usage:
EmailAddressIsValid($my_email_address);//returns boolean
Example:
if (EmailAddressFormatIsValid($my_email_address))
echo "Email address is valid";
else
echo "Email address does not exist";
Feedback
How useful do you rate this javascript?
Excellent
Good
Neutral
Poor
Current Results
Create a FREE Alxnet Web Poll
Home Page
|
Javascript Resources
|
php Resources
Copyright © 2003
Computational Neural Systems
Inspired by
The Personal Best