1
1
10112017-02-26 18:07:02
JavaScript
1011, 2017-02-26 18:07:02

Authorization by phone on the site. How to do?

You need to register users by phone numbers and not by email, the site on php
numbers can be of different lengths, as country codes are of different lengths. How would you organize...

  1. Checking the number at check-in? php or js? If JS, what scripts do you recommend for the input mask in the phone field?
  2. What do you think is the best number to store the number in the database? Will this one fit? +X(XXX)XXX-XX-XX
  3. View of the number on the site, in the user's personal account

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Polin, 2017-02-26
@1011

My vision of the situation.
You need to check both on the client and on the server. Client protection is foolproof.
You need to store it as the user enters, and he should only enter numbers. That is, the storage is as follows: XXXXXXXXXXX
Of course, a human-readable format like: +X(XXX)XXX-XX-XX
Well, the last and most difficult thing. The user must confirm the phone number, which means you will need an SMS gateway. And, perhaps, this is the first thing to take care of. Without number verification, there is a possibility that the user may enter a useless set of numbers, which later turns out to be someone's phone number, which is not good.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question