Hi Folks, I have a site that has a form that checks for a valid email address. Right now everything is working fine for any emails that come in listed as People who have an email that reads are getting an "invalid email" error. The code presently reads as this: if(eregi("^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$emailAddr)){ Code (markup): What can I add to this code to allow users with name.XX.XX.com emails to get through? $3 to the first to answer (other than NOT using the verify process ) Terry
Try this dont know if it will work. if(eregi("^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$emailAddr)){ bla bla } elseif(eregi("^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\+.[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$emailAddr)) { } Code (markup): Havent tested it out so could contain some errors but play around with that might just work.
Thanks guys, no luck. I'm going to clarify and show a little more of the code. I know somebody is going to catch what to do as soon as they see it. $emailAddr = $_GET['email']; if(eregi("^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]+\.[a-zA-Z.]{2,5}$",$emailAddr)){ $ip = $_SERVER['REMOTE_ADDR']; $name = $_GET['name']; $country = $_REQUEST['country']; if(mysql_num_rows(mysql_query("SELECT * FROM contestant WHERE ip='$ip'"))!=NULL){ echo "<div id=\"content-contest\"><div class=\"contest-txt-2\"><p>Someone has already registered for this contest from your IP address. We limit one entry per IP. This is to prevent duplicate entries.</p></div></div>"; Code (markup):
if(eregi("^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]+\.[a-zA-Z.]{2,5}$",$emailAddr) || eregi("^[a-zA-Z0-9._-]+@[a-zA-Z0-9-]+\.[a-zA-Z.]{2,5}$",$emailAddr)){ PHP: This should work. Regards, Bronto
Thank you Bronto, that worked perfectly. Thank you scrabblenerd and networktown for your assistance. Terry