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.