php寫的簡訊介面(全網支援)

來源:互聯網
上載者:User
  • 適用行業:金融、工商、稅務、電力、貿易、商業、旅遊、政府、郵政、教育等行業

    適用類型:掛接各種B/S系統,作為各類辦公系統、ERP、CRM、電子商務平台的外掛程式(如群發簡訊會議通知、會員/客戶關係交流、訂單組建通知、發貨通知、議程提醒、催費通知等等)

    特 點: 綠色簡訊,合法正規通道,全網收發
    支援移動、聯通、電信、網通簡訊,雙向互動,可回複 高速群發

    免費帳號申請(請註明來自"ChinaUnix",贈送50條簡訊,測試簡訊不夠用的話再聯絡我)
    QQ:670168401(申請帳號) QQ群:199217(簡訊介面應用交流)


    * 簡訊URL介面詳細參數說明檔案: Http://app.37du.net/簡訊URL介面參數說明.doc

    * 簡訊介面檔案:
    <?php

    /*根據參數,產生調用URL,因為是測試例子,不對變數為空白的情況做處理*/

    $http = "http://interface.85521.com/interface_sms_url.ajax"; // 介面檔案地址
    $LoginName = ""; // 簡訊帳號
    $pass = ""; // 簡訊帳號密碼
    $Code = ""; // 業務代碼,預設為空白
    $subid = ""; // 子號,預設為空白
    $sender = ""; // 發送號碼
    $receivers = ""; // 接收號碼,多個手機號以分號 ; 分隔
    $setTimer = ""; // 定時發送時間,格式:YYYY-MM-DD HH:MM ,即時發送則不需要
    $message = ""; // 簡訊內容
    $cmd = ""; // 操作命令,傳送簡訊值為send,查詢回複值為query,查詢帳號簡訊餘額為remain
    $allowForward = ""; // 轉寄支援,預設為0
    $system = ""; // 應用平台,預設為空白(windows),其他平台值:unix或linux

    $url = $http."?LoginName=".$LoginName."&pass=".$pass."&Code=".$Code."&subid=".$subid."&sender=".$sender."&receivers=".$receivers."&setTimer=".$setTimer."&message=".urlencode($message)."&cmd=".$cmd."&allowForward=".$allowForward."&system=".$system;

    /* windows平台叫用介面形式:MSXML,發送請求*/
    // ----------------------------------------------------------------------------
    $objHttpRequest=new COM("MSXML2.ServerXMLHTTP");
    if (is_null($objHttpRequest)) {
    echo "create Msxl2.ServerXMLHTTP error";
    exit();
    }
    $objHttpRequest->open("GET",$URL,False);
    $objHttpRequest->send();
    if ($objHttpRequest->status <> 200) {
    /*返回錯誤*/
    echo "open Request error";
    exit();
    }
    /*擷取返回的資訊*/
    $retMsg=$objHttpRequest->responseText;
    $objHttpRequest=NULL;
    // ----------------------------------------------------------------------------


    /* 通用調用用介面形式,(其他平台linux、unix)*/
    // ----------------------------------------------------------------------------
    $file = $http."?LoginName=".$LoginName."&pass=".$pass."&Code=".$Code."&subid=".$subid."&sender=".$sender."&receivers=".$receivers."&setTimer=".$setTimer."&message=".urlencode($message)."&cmd=".$cmd."&allowForward=".$allowForward."&system=".$system;
    $fp = fopen($file,"r");
    $retMsg = fgetss($fp); // $retMsg = fgetss($fp,1024);
    fclose($fp);
    // ----------------------------------------------------------------------------


    /* 根據返回的資訊($retMsg,形式如下)擷取相應的內容,參數含義請參考“簡訊介面參數說明”
    windows平台返回形式如下:

    <?xml version="1.0" encoding="utf-8" ?>
    - <SendSmsReport>
    - <Summary>
    <Success />
    <Fail />
    <RetCode>-6</RetCode>
    <SmsRemain />
    <ErrPhones />
    </Summary>
    </SendSmsReport>

    其他平台返回形式如下:

    [SendSmsReport]
    [Summary]
    [Success][/Success]
    [Fail][/Fail]
    [RetCode]-6[/RetCode]
    [SmsRemain][/SmsRemain]
    [ErrPhones][/ErrPhones]
    [/Summary]
    [/SendSmsReport]

    */
    ?>


  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.