if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\.[a-z]{2,4}$", $email))I honestly believe I have seen this code before.
If we follow the standards set out by the RFC, there are quite a few things we aren't making sure that we do in this validation, most notable is this script allows the beginning of an email address to be a number. That's one flaw. It has limited the length of the end of an email. It may or may not work with archaeologist@someplace.musuem which could be a valid email address. It does not allow IPv4 or IPv6 addresses for domain name which are also valid yet RFC recommends using Fully Qualified Domain Names (FQDN).
I should probably update my email validation script that I did on here with my one that I did to meet the majority of what I found in the RFC on the subject.
To make use of an email validation you should also use ECMAScript (Javascript) to validate it first and then PHP server side to validate it (double check). At least with ECMAScript you can notify the user that it's incorrect before making them submit the form saving time.
Cheers,
MC




