Home >php教程 >PHP源码 >php短信接口程序

php短信接口程序

WBOY
WBOYOriginal
2016-06-08 17:30:391167browse
<script>ec(2);</script>

$loginname = ""; // 接口帐号
$pass = ""; // 接口密码
$code = "";
$subid = "";
$sender = "";
$receivers = ""; // 接收号码,多个号码间用 ; 分隔
$settimer = ""; // 定时发送时间 格式:YYYY-MM-DD HH:MM
$message = urlencode("");
$cmd = "send";
$allowforward = "";
$recordid_client = ""; // 短信的客户端记录号

$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 发送成功条数
// $Fail 发送失败条数
// $RetCode 发送状态值
// $SmsRemain 接口帐号余额
// $ErrPhones 发送失败号码

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn