CodeIgniter Forums
Problem with the email validation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Problem with the email validation (/showthread.php?tid=52851)



Problem with the email validation - El Forum - 06-29-2012

[eluser]Unknown[/eluser]
"[email protected]"
The email in the double quote is getting error while validating.
Codeigniter is not allowing this email.
Whereas this is a valid gmail account.

Can someone plz help me.



Problem with the email validation - El Forum - 06-29-2012

[eluser]marcogmonteiro[/eluser]
the function valid_email is probably not allowing you to have 2 points after the @. Not sure though. I'm not that good at regex but look at the code inside the form validation lib .

Code:
public function valid_email($str)
{
  return ( ! preg_match("/^([a-z0-9\+_\-]+)(\.[a-z0-9\+_\-]+)*@([a-z0-9\-]+\.)+[a-z]{2,6}$/ix", $str)) ? FALSE : TRUE;
}

maybe someone can help you from here.


Problem with the email validation - El Forum - 06-29-2012

[eluser]Unknown[/eluser]
Thanks a lot ....