PHP written SMS interface (full network support)

Source: Internet
Author: User
Tags exit empty query urlencode linux
  • Applicable industries: Finance, industry and commerce, taxation, electricity, trade, commerce, tourism, government, postal services, education and other industries

    Applicable type: Hook up a variety of B/s system, as a variety of office systems, ERP, CRM, E-commerce platform Plug-ins (such as mass Message Conference notification, member/customer relationship, order generation notice, delivery notice, schedule reminders, reminders, etc.)

    Features: Green SMS, legal regular channel, full network transceiver
    Support Mobile, Unicom, Telecom, netcom SMS, two-way interaction, can respond to high speed mass

    Free Account Application (please specify from "Chinaunix", give 50 text message, Test text message is not enough to contact me again)
    qq:670168401 (Application account) QQ Group: 199217 (SMS Interface Application communication)


    * SMS URL Interface detailed parameter description file:Http://app.37du.net/SMS URL interface parameter description. doc

    * SMS Interface file:
    <?php

    /* Based on the parameters, generate the call URL, because it is a test example, do not have the variable empty case to do the processing * *

    $http = "Http://interface.85521.com/interface_sms_url.ajax"; Interface file Address
    $LoginName = ""; SMS Account
    $pass = ""; SMS Account password
    $Code = ""; Business code, default is NULL
    $subid = ""; Child number, default is empty
    $sender = ""; Send number
    $receivers = ""; Receive number, multiple cell phone number with semicolon; Separated
    $setTimer = ""; Timed delivery time, format: YYYY-MM-DD hh:mm, Instant send is not required
    $message = ""; SMS Content
    $cmd = ""; Operation command, send text message value for Send, query reply value for query, inquiry account SMS balance for remain
    $allowForward = ""; Forwarding support, defaults to 0
    $system = ""; Application platform, default to Null (Windows), other platform values: UNIX or 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 platform invoke interface form: MSXML, send request * *
    // ----------------------------------------------------------------------------
    $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) {
    /* Return Error * *
    echo "Open Request error";
    Exit ();
    }
    /* Get the information returned/*
    $RETMSG = $objHttpRequest->responsetext;
    $objHttpRequest =null;
    // ----------------------------------------------------------------------------


    /* Universal call in interface form, (other platform 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);
    // ----------------------------------------------------------------------------


    /* According to the returned information ($RETMSG, form below) to obtain the appropriate content, parameter meaning please refer to "SMS Interface parameter description"
    The Windows platform return form is as follows:

    <?xml version= "1.0" encoding= "Utf-8"?>
    -<SendSmsReport>
    -<Summary>
    <success/>
    <fail/>
    <RetCode>-6</RetCode>
    <smsremain/>
    <errphones/>
    </Summary>
    </SendSmsReport>

    Other platform return forms are as follows:

    [Sendsmsreport]
    [Summary]
    [Success] [/success]
    [Fail] [/fail]
    [Retcode]-6[/retcode]
    [Smsremain] [/smsremain]
    [Errphones] [/errphones]
    [/summary]
    [/sendsmsreport]

    */
    ?>


  • 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.