Php text message verification problems

Source: Internet
Author: User
Now you have an SMS interface, for example, 192.144.1.168MJSuserverificationSign? Useraccounts18061921332 enter the address directly in the browser and have text message verification, but may you please tell me how to click the "send" button and then send the text message... now you have an SMS interface, such as http: // 192.144.1.168/MJS/user/verificationSign? UserAccounts = 18061910932 enter the address directly in the browser and have text message verification. But how can you achieve this effect by clicking "send" and then sending text messages ??

Reply content:

Now you have an SMS interface, such as http: // 192.144.1.168/MJS/user/verificationSign? UserAccounts = 18061910932 enter the address directly in the browser and have text message verification. But how can you achieve this effect by clicking "send" and then sending text messages ??

Click send and then want the server to initiate an ajax request. Then, save the verification code to the session or kv database.

This is not a php issue. This is why the front-end sends an ajax request to the SMS interface after the user clicks the send button.

1. The front-end ajax sends the mobile phone number to the background
2. Get the mobile phone number in the background. Generate verification codes and other required information according to your own rules.
3. Send data in the format specified by the interface.
4. Obtain the returned data of the interface. If the verification code is successful, the time when the verification code, mobile phone number, and verification code are generated is saved to the session. Failed. An error message is returned to the front-end.
5. Verify the SMS verification code by using the mobile phone number, verification code, and time.

Generally, the SMS interface is provided by sdks. Follow the SDK operations.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.