search
Homephp教程php手册php写的短信接口(全网支持)

  • 适用行业:金融、工商、税务、电力、贸易、商业、旅游、政府、邮政、教育等行业

    适用类型:挂接各种B/S系统,作为各类办公系统、ERP、CRM、电子商务平台的插件(如群发短信会议通知、会员/客户关系交流、订单生成通知、发货通知、日程提醒、催费通知等等)

    特 点: 绿色短信,合法正规通道,全网收发
    支持移动、联通、电信、网通短信,双向互动,可回复 高速群发

    免费帐号申请(请注明来自"ChinaUnix",赠送50条短信,测试短信不够用的话再联系我)
    QQ:670168401(申请帐号) QQ群:199217(短信接口应用交流)


    * 短信URL接口详细参数说明文件: Http://app.37du.net/短信URL接口参数说明.doc

    * 短信接口文件:

    /*根据参数,生成调用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平台返回形式如下:


    -
    -


    -6





    其他平台返回形式如下:

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

    */
    ?>


  • 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

    Hot AI Tools

    Undresser.AI Undress

    Undresser.AI Undress

    AI-powered app for creating realistic nude photos

    AI Clothes Remover

    AI Clothes Remover

    Online AI tool for removing clothes from photos.

    Undress AI Tool

    Undress AI Tool

    Undress images for free

    Clothoff.io

    Clothoff.io

    AI clothes remover

    Video Face Swap

    Video Face Swap

    Swap faces in any video effortlessly with our completely free AI face swap tool!

    Hot Tools

    mPDF

    mPDF

    mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

    EditPlus Chinese cracked version

    EditPlus Chinese cracked version

    Small size, syntax highlighting, does not support code prompt function

    SecLists

    SecLists

    SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

    SublimeText3 English version

    SublimeText3 English version

    Recommended: Win version, supports code prompts!

    PhpStorm Mac version

    PhpStorm Mac version

    The latest (2018.2.1) professional PHP integrated development tool