Liquid Fire Posted February 5, 2007 Share Posted February 5, 2007 code: $email_valid = ereg('^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$', $_REQUEST['email']); error message: Warning: ereg() [function.ereg]: REG_ERANGE in D:\root\projecttracker\include\validateemail.php on line 18 why am i getting this error message when trying to validate an email address? Quote Link to comment Share on other sites More sharing options...
Orio Posted February 5, 2007 Share Posted February 5, 2007 The "range" character (a dash) has a special meaning inside square brackets. You need to escape it: $email_valid = ereg('^[\w\-\.]+@([\w\-]+\.)+[\w\-]{2,4}$', $_REQUEST['email']); Orio. Quote Link to comment 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.