Applicable industries: finance, industry and commerce, taxation, electricity, trade, commerce, tourism, government, postal service, education and other industries Applicable types: connected to various B/S systems, used as various office systems, ERP, CRM, Plug-ins for e-commerce platforms (such as group text message meeting notifications, member/customer relationship communication, order generation notifications, shipping notifications, schedule reminders, reminder notifications, etc.) Features: Green text messages, legal and formal channels, sending and receiving across the entire network Supports text messages from China Mobile, China Unicom, China Telecom, and China Netcom, two-way interaction, and can reply to high-speed group messages Free account application (please indicate that you are from "Shangmai Unlimited SMS Interface", 50 text messages will be given as a gift, please contact me if the test text messages are not enough) * SMS interface file: /*-------------------------------- Function: Unlimited business connections PHP HTTP interface to send SMS Modification date: 2011-04-08 Description: http://http.smsdk.com/tx/?uid=user account&pwd=MD5-digit 32-digit password&mobile=number&content=content Status: 100 Sent successfully 101 Verification failed 102 Insufficient text messages 103 Operation failed 104 Illegal characters 105 Too much content 106 Too many numbers 107 Frequency too fast 108 Number content is empty 109 Account frozen 110 Frequent single sending is prohibited 111 The system is tentatively sending 112 The number is incorrect 120 System upgrade --------------------------------*/ $uid = '9999'; //User account $pwd = '9999'; //Password $mobile = '13912341234,13312341234,13512341234,02122334444'; //Number $content = 'Shangmai Wuxian PHP HTTP interface '; //Content //Send immediately $res = sendSMS($uid,$pwd,$mobile,$content); echo $res;
//Send regularly /* $time = '2010-05-27 12:11'; $res = sendSMS($uid,$pwd,$mobile,$content,$time); echo $res ; */ function sendSMS($uid,$pwd,$mobile,$content,$time='',$mid='') { $http = 'http://http.c123.com/tx /'; $data = array ( 'uid'=>$uid, //User account 'pwd'=>strtolower(md5($pwd)), //MD5-digit 32 password 'mobile'=> $mobile, //Number 'content'=>$content, //Content 'time'=>$time, //Send regularly 'mid'=>$mid //Sub extension number ); $re = postSMS($http,$data); //POST submission if( trim($re) == '100' ) { return "Send successfully!"; } else { return "Send failed ! Status: ".$re; } }
function postSMS($url,$data='') { $row = parse_url($url); $host = $row['host']; $port = $row['port'] ? $row['port']:80; $file = $row['path']; while (list($k,$v) = each($data)) { $post .= rawurlencode($ k)."=".rawurlencode($v)."&"; //Convert to URL standard code } $post = substr( $post , 0 , -1 ); $len = strlen($post); $fp = @fsockopen( $host ,$port, $errno, $errstr, 10); if (!$fp) { return "$errstr ($errno)n"; } else { $receive = ''; $out = "POST $file HTTP/1.1rn"; $out .= "Host: $hostrn"; $out .= "Content-type: application/x-www-form-urlencodedrn"; $out .= "Connection: Closern"; $out .= "Content-Length: $lenrnrn"; $out .= $post; fwrite($fp, $out); while (!feof($ fp)) { $receive .= fgets($fp, 128); } fclose($fp); $receive = explode("rnrn",$receive); unset($receive[0]); return implode("",$receive); } } ?> Detailed introduction: http://www.smsdk.com/a/gb2312/news/20111205/117.html
- * SMS interface file:
- /*--------------------------------
- Function : Shangmai Wuxian PHP HTTP interface to send text messages
- Modification date: 2011-04-08
- Instructions: http://http.smsdk.com/tx/?uid=user account&pwd=MD5-digit 32-digit password&mobile=number&content=content
- Status:
- 100 Successfully sent
- 101 Verification failed
- 102 Insufficient text message
- 103 Operation failed
- 104 Illegal characters
- 105 Too much content
- 106 Too many numbers
- 107 Frequency too fast
- 108 Number content is empty
- 109 Account frozen
- 110 Prohibited Frequent single message sending
- 111 The system is tentatively sending it
- 112 The number is incorrect
- 120 System upgrade
- ---------------------------------- -*/
- $uid = '9999'; //User account
- $pwd = '9999'; //Password
- $mobile = '13912341234,13312341234,13512341234,02122334444'; //Number
- $content = 'Business Line Unlimited PHP HTTP interface'; //Content
- //Send immediately
- $res = sendSMS($uid,$pwd,$mobile,$content);
- echo $res;
- //Send regularly
- /*
- $time = '2010-05-27 12:11';
- $res = sendSMS($uid,$pwd,$mobile,$content,$time);
- echo $res;
- */
- function sendSMS($uid,$ pwd,$mobile,$content,$time='',$mid='')
- {
- $http = 'http://http.c123.com/tx/';
- $data = array
- (
- ' uid'=>$uid, //User account
- 'pwd'=>strtolower(md5($pwd)), //MD5-digit 32 password
- 'mobile'=>$mobile, //Number
- 'content '=>$content, //Content
- 'time'=>$time, //Send regularly
- 'mid'=>$mid //Sub-extension number
- );
- $re= postSMS($http, $data); //POST method submission
- if( trim($re) == '100' )
- {
- return "Sent successfully!";
- }
- else
- {
- return "Sending failed! Status:".$ re;
- }
- }
-
- function postSMS($url,$data='')
- {
- $row = parse_url($url);
- $host = $row['host'];
- $port = $row ['port'] ? $row['port']:80;
- $file = $row['path'];
- while (list($k,$v) = each($data))
- {
- $ post .= rawurlencode($k)."=".rawurlencode($v)."&"; //Convert to URL standard code
- }
- $post = substr( $post , 0 , -1 );
- $len = strlen($post);
- $fp = @fsockopen( $host ,$port, $errno, $errstr, 10);
- if (!$fp) {
- return "$errstr ($errno)n";
- } else {
- $receive = '';
- $out = "POST $file HTTP/1.1rn";
- $out .= "Host: $hostrn";
- $out .= "Content-type: application/x-www -form-urlencodedrn";
- $out .= "Connection: Closern";
- $out .= "Content-Length: $lenrnrn";
- $out .= $post;
- fwrite($fp, $out);
- while (!feof($fp)) {
- $receive .= fgets($fp, 128);
- }
- fclose($fp);
- $receive = explode("rnrn",$receive);
- unset($ receive[0]);
- return implode("",$receive);
- }
- }
- ?>
- Detailed introduction: http://www.smsdk.com/a/gb2312/news/20111205/117.html
-
-
Copy code
|