S
S
Simple912016-03-24 12:36:27
PHP
Simple91, 2016-03-24 12:36:27

How to make sms - activation or verification code in php?

Hi friends!
There was a need for the user to send a randomly generated SMS code to verify his phone number. I've never experienced this before so I don't know where to start. The materials on the web are either outdated or incomplete, not correct.
Algorithm of actions
1. The user enters his phone number
2. An SMS code is sent to him
3. The user enters the received code
4. If the code is correct, the user goes further
My problems and difficulties

  • I don't know how to randomly generate code. I suspect that in php, then I write to a variable and send to mysql, I write to a table
  • I chose to send the SMS mailing service, I will use their api. I suspect that I will take the generated code from the database and send SMS to the user. Then when the user enters, I will simply do a comparison with the code in the database
Alternative
Not so long ago I downloaded the vk authorizer, I don’t understand how it works, but I take the codes from there and go to VK.
Is there a similar new solution to bypass SMS?
Are my actions correct? Are there ready-made solutions, or more convenient ways?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question