TheJoey Posted September 7, 2009 Share Posted September 7, 2009 if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) $errorEmail = true;[/code im getting this syntax error [code]Deprecated: Function eregi() is deprecated in C:\xampplite\htdocs\Trial\New Folder\save.php on line 88 Quote Link to comment https://forums.phpfreaks.com/topic/173362-php-error-with-this-line-of-code/ Share on other sites More sharing options...
kratsg Posted September 7, 2009 Share Posted September 7, 2009 if (!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i", $email)) $errorEmail = true; Quote Link to comment https://forums.phpfreaks.com/topic/173362-php-error-with-this-line-of-code/#findComment-913870 Share on other sites More sharing options...
PFMaBiSmAd Posted September 7, 2009 Share Posted September 7, 2009 That's not a syntax error, read it. eregi() is deprecated (look that up if you don't know what it means.) You should use preg_match instead. Quote Link to comment https://forums.phpfreaks.com/topic/173362-php-error-with-this-line-of-code/#findComment-913871 Share on other sites More sharing options...
kratsg Posted September 7, 2009 Share Posted September 7, 2009 I forgot to mention (can't seem to edit my post!) You do not have delimiters around your "pattern" which I always check for first if I seem to have an error with preg_match/ereg. Quote Link to comment https://forums.phpfreaks.com/topic/173362-php-error-with-this-line-of-code/#findComment-913873 Share on other sites More sharing options...
TheJoey Posted September 7, 2009 Author Share Posted September 7, 2009 thanks guys ill read into it. Quote Link to comment https://forums.phpfreaks.com/topic/173362-php-error-with-this-line-of-code/#findComment-913881 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.