Glese Posted December 2, 2011 Share Posted December 2, 2011 This question may be a bit philosophical. As of now I am trying to use: filter_var($email_address, FILTER_VALIDATE_EMAIL) Though in my opinion it allows a bit too much. Then again, is it necessary to have a strict email validation, what is your take on this? It does allow: &&&lol@lol.com And also: blub@blub.conyon I do not know if there are email services which even allow an email like the first one, and I also found out that the validation also does not check for the extension of the email, then again, how necessary is it, and how good can you check for it? What are your suggestions on this one? Quote Link to comment https://forums.phpfreaks.com/topic/252287-does-it-make-sense-to-have-the-php-email-validation-stricter/ Share on other sites More sharing options...
Spring Posted December 2, 2011 Share Posted December 2, 2011 I would think it's personal opinion and also dependent on how important the users email is for your site. Yours seems fine to me, If someone wants to troll around with the email there's no point in stopping them. Quote Link to comment https://forums.phpfreaks.com/topic/252287-does-it-make-sense-to-have-the-php-email-validation-stricter/#findComment-1293574 Share on other sites More sharing options...
premiso Posted December 2, 2011 Share Posted December 2, 2011 It is a valid email, either or, according to the RFC standards. The real goal is, to send a validation email and make them click a "link" to activate their account. This weeds out random email addresses that are bad. Quote Link to comment https://forums.phpfreaks.com/topic/252287-does-it-make-sense-to-have-the-php-email-validation-stricter/#findComment-1293583 Share on other sites More sharing options...
Glese Posted December 3, 2011 Author Share Posted December 3, 2011 Premiso, I thought about this and I think you are right. The programmers of these functions try to go by what makes sense, which I am glad about, and as you said it is a valid email nevertheless by the standards, thus creating a too strict function would work against this. Checking for the @ and the dot at the extension, and also to certain special characters in this case so that the email validates to the standards would be enough in this case. They do follow procedures the way it is meant to be, which I am glad about as said. Quote Link to comment https://forums.phpfreaks.com/topic/252287-does-it-make-sense-to-have-the-php-email-validation-stricter/#findComment-1293868 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.