littlepeg Posted May 4, 2007 Share Posted May 4, 2007 hi everybody, would you please have a look at these code and help me to solve this problem. Any help would be grately and appreciated. When I tried to validate the email for the registration form. There is an error message as follows: Warning: eregi() [function.eregi]: REG_ERANGE in C:\wamp\www\snyp\registration.php on line 64 The codes are below: if (!empty($_POST['email'])) { if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9- ]+)*(\.[a-z]{2,3})$", $psd)){ $errors[] = 'Sorry, the email is not valid'; } else { $psd = $_POST['email']; } } else { $errors[] = 'You forgot to enter your email.'; } Link to comment https://forums.phpfreaks.com/topic/50065-solved-please-help-me-with-the-email-validation/ Share on other sites More sharing options...
yzerman Posted May 4, 2007 Share Posted May 4, 2007 Try this: if (!eregi("^[[:alnum:]][a-z0-9_.-]*@[a-z0-9.-]+\.[a-z]{2,4}$", stripslashes(trim($_POST['email'])))) { Link to comment https://forums.phpfreaks.com/topic/50065-solved-please-help-me-with-the-email-validation/#findComment-245726 Share on other sites More sharing options...
littlepeg Posted May 4, 2007 Author Share Posted May 4, 2007 Thank you very much yzerman, you are so great!! It works fine now!! Link to comment https://forums.phpfreaks.com/topic/50065-solved-please-help-me-with-the-email-validation/#findComment-245749 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.