US Phone Number Verification

前端 未结 13 1780
眼角桃花
眼角桃花 2020-11-30 14:00

I have a website form that requires a US phone number input for follow up purposes, and this is very necessary in this case. I want try to eliminate users entering junk data

13条回答
  •  时光说笑
    2020-11-30 14:45

    It seems to me that you're putting more effort into this than it warrants. Consider:

    If your purpose is to guard against mis-entered phone numbers, then you can probably catch well over 90% of them with just a very simple check.

    If your purpose is to try to force users to provide a valid number whether they want to give that information out or not, then you've taken on a hopeless task - even if you were able to access 100% accurate, up-to-the-second telco databases to verify that the exact number entered is currently live, you still don't gain any assurance that the number they gave you is their own. Once again, a simple check will foil the majority of people entering bogus numbers, but those who are willing to try more than two or three times will find a way to defeat your attempts to gain their numbers.

    Either way, a simple test is going to get you good results and going into more complex rule sets will take up increasingly more time while providing increasingly little benefit to you (while also potentially adding false positives, as already shown with the "seven of the same digit" and 867-5309 cases).

提交回复
热议问题