Terfanda Posted June 20, 2006 Share Posted June 20, 2006 function emailcheck($Email) { if (eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $Email)) { $ans1=FALSE; } else { $ans1= TRUE; } return $ans1; } Hello agian I will be very thankfull if someone help I am using this function up it seems it is wrong can someone tells me where is my mistake i am calling it here:::::: $acc=emailcheck("$Email");and i am using this if condition to give me a final answer::::: if (($acc==TRUE)AND($acc1==TRUE))I will be very greatfull if someone helps me thank you Link to comment https://forums.phpfreaks.com/topic/12441-email-validation/ Share on other sites More sharing options...
hackerkts Posted June 20, 2006 Share Posted June 20, 2006 This is what I did, hope you know where you went wrong.[code]<?phpfunction validateEmail($email){ $email_pattern = '^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$'; if (eregi ($email_pattern, $email) ) { $ans1 = TRUE; } else { $ans1 = FALSE; } return $ans1;}if (validateEmail("[email protected]") == TRUE) { echo "TRUE"; } else { echo "FALSE"; }?>[/code] Link to comment https://forums.phpfreaks.com/topic/12441-email-validation/#findComment-47554 Share on other sites More sharing options...
Terfanda Posted June 20, 2006 Author Share Posted June 20, 2006 [!--quoteo(post=385892:date=Jun 20 2006, 10:08 AM:name=hackerkts)--][div class=\'quotetop\']QUOTE(hackerkts @ Jun 20 2006, 10:08 AM) [snapback]385892[/snapback][/div][div class=\'quotemain\'][!--quotec--]This is what I did, hope you know where you went wrong.[code]<?phpfunction validateEmail($email){ $email_pattern = '^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$'; if (eregi ($email_pattern, $email) ) { $ans1 = TRUE; } else { $ans1 = FALSE; } return $ans1;}if (validateEmail("[email protected]") == TRUE) { echo "TRUE"; } else { echo "FALSE"; }?>[/code][/quote][!--quoteo(post=385887:date=Jun 20 2006, 08:16 AM:name=Terfanda)--][div class=\'quotetop\']QUOTE(Terfanda @ Jun 20 2006, 08:16 AM) [snapback]385887[/snapback][/div][div class=\'quotemain\'][!--quotec--]function emailcheck($Email) { if (eregi("^[a-zA-Z0-9_]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-\.]+$]", $Email)) { $ans1=FALSE; } else { $ans1= TRUE; } return $ans1; } Hello agian I will be very thankfull if someone help I am using this function up it seems it is wrong can someone tells me where is my mistake i am calling it here:::::: $acc=emailcheck("$Email");and i am using this if condition to give me a final answer::::: if (($acc==TRUE)AND($acc1==TRUE))I will be very greatfull if someone helps me thank you[/quote]Thank You I understood it and i will try it Link to comment https://forums.phpfreaks.com/topic/12441-email-validation/#findComment-47556 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.