Php text message interface program-PHP source code

Source: Internet
Author: User
Ec (2); $ loginname & quot; interface account $ pass & quot; Interface Password $ code & quot ;; $ subid & quot; $ sender & quot; $ receivers & quot; Receive number, used for multiple numbers; separate $ settime scripts ec (2); scripts

$ Loginname = ""; // interface account
$ Pass = ""; // Interface Password
$ Code = "";
$ Subid = "";
$ Sender = "";
$ Receivers = ""; // receive number. Separate multiple numbers;
$ Settimer = ""; // scheduled sending time format: YYYY-MM-DD HH: MM
$ Message = urlencode ("");
$ Cmd = "send ";
$ Allowforward = "";
$ Recordid_client = ""; // client record number of the SMS

$ Http = "http://interface.37du.net/interface_sms_url.ajax ";
$ File = $ http ."? Loginname = ". $ loginname. "& pass = ". $ pass. "& code = ". $ code. "& subid = ". $ subid. "& sender = ". $ sender. "& receivers = ". $ receivers. "& settimer = ". $ settimer. "& message = ". $ message. "& cmd = ". $ cmd. "& allowforward = ". $ allowforward. "& recordid_client = ". $ recordid_client;

$ Xml = new XMLReader ();
$ Xml-> open ($ file );
$ Xml-> setParserProperty (2, true );
While ($ xml-> read ()){
Switch ($ xml-> name ){
Case "Success": $ xml-> read ();
$ Success = $ xml-> value;
$ Xml-> read ();
Break;
Case "Fail": $ xml-> read ();
$ Fail = $ xml-> value;
$ Xml-> read ();
Break;
Case "RetCode": $ xml-> read ();
$ RetCode = $ xml-> value;
$ Xml-> read ();
Break;
Case "SmsRemain": $ xml-> read ();
$ SmsRemain = $ xml-> value;
$ Xml-> read ();
Break;
Case "ErrPhones": $ xml-> read ();
$ ErrPhones = $ xml-> value;
$ Xml-> read ();
Break;
}
}
$ Xml-> close ();
// $ Success number of successfully sent messages
// $ Number of failed Fail messages
// $ RetCode sending status value
// $ SmsRemain interface account balance
// $ ErrPhones failed to send Number

Related Article

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.