This function checks the validity of any given e-mail address. It checks ALL CURRENT (as of today, 8.19.03) top level domains. I may have missed one or two, but I think I got them all now! Check it out!
if(validate_email($email)) { echo "E-mail is valid"; } else { echo "Either the e-mail is not valid, or the top level domain is not included in the email validation list."; } ?>
<?php /* Comments You don't need this portion to use the script. You may safely delete this To test it out for fun, you could upload this script to your server...
point your browser to it http://www.YOURSITE.com/scriptName.php
and append this to it: ?email=me@you.net so it looks like this http://www.YOURSITE.com/scriptName.php?email=me@you.net
This would give the output: E-mail is valid
Since "net" is in the above list.. it returns 1 (true)
this would return 0 (false): Either the e-mail is not valid, or the top level domain is not included in the email validation list.
It returns 0 because "mistake" isn't in the list above.
To update the list, just add new extensions to the list above when they become available!
Hope ya like it
*/
?>
DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.