Through the authentication code SMS HTTP call interface, you can quickly integrate the mobile phone number verification function in the website or the app, which is just the core code, can be expanded according to your actual needs.
<?phpfunction Post ($curlPost, $url) {$curl = Curl_init (); curl_setopt ($curl, Curlopt_url, $url); curl_setopt ($curl, Curlopt_header, False); curl_setopt ($curl, Curlopt_returntransfer, True); curl_setopt ($curl, Curlopt_nobody, true); curl_setopt ($curl, Curlopt_post, True); curl_setopt ($curl, Curlopt_postfields, $curlPost); $return _str = curl_exec ($ Curl); Curl_close ($curl); return $return _str;} $target = "Http://106.ihuyi.com/webservice/sms.php?method=Submit";//Replace with your own test account, parameter order and wenservice corresponding $post_data = " account= username &password= Password &mobile= mobile phone number &content= ". Rawurlencode (" Your Verification code is: 4852.) Please do not divulge the verification code to other people. "),//$binarydata = Pack (" A ", $post _data), echo $gets = post ($post _data, $target), parse the $gets string yourself and implement your own logic?>
self-application account address:http://www.ihuyi.com/product.php
Full interface file address:Http://www.ihuyi.com/upload/file/cu-fa-jie-kou.rar
PHP via HTTP Call Verification code SMS Interface source code