zoukankan      html  css  js  c++  java
  • 一些有用的API 之 飛信發短信

    飛信API
    <html>
    <head runat="server">
    <title>Send Message</title>
    <script language="javascript" type="text/javascript">
    function CreateXmlHttp()
    {
    if(window.ActiveXObject)
    {
    return new ActiveXObject("Microsoft.XMLHTTP");
    }
    else if (window.XMLHttpRequest)
    {
    return new XmlHttpRequest();
    }
    }

    function Confirm_onclick()
    {
    var myPhone = document.getElementById("MyPhoneNum").value;//$get("MyPhoneNum").value;
    var myPWD = document.getElementById("MyPassword").value;//$get("MyPassword").value;
    var otherPhone = document.getElementById("SelectOtherPhone").value;//$("SelectOtherPhone").options[$("SelectOtherPhone").selectedIndex].value;
    var content = document.getElementById("Content").value;//$get("Content").value;
    if(myPhone==""||myPWD==""||otherPhone==""||content=="")
    {
    alert(
    "請填完資料");
    return;
    }


    var ParamString = "username="+myPhone+"&password="+myPWD+"&sendto="+otherPhone+"&message="+content;
    var url="https://sms.api.bz/fetion.php?";
    encodeURIComponent(url);
    var XmlHttpObject = CreateXmlHttp();
    XmlHttpObject.onreadystatechange
    = function(){
    if(XmlHttpObject.readyState==4){
    if(XmlHttpObject.status == 200){
    alert(XmlHttpObject.responseText);
    }
    else if(XmlHttpObject.status==404){
    alert(
    "URL doesn't exists!");
    }
    else{
    alert(
    "Error:Status is "+XmlHttpObject.status);
    }
    }
    }
    XmlHttpObject.open(
    "post",url,true);
    XmlHttpObject.setRequestHeader(
    "Content-Type","application/x-www-form-urlencoded;charset=utf-8");
    XmlHttpObject.send(ParamString);
    }

    </script>
    </head>
    <body>
    <form id="form1" runat="server">
    <div>
    我的電話:
    <input id="MyPhoneNum" type="text" value="15895663693"/><%--value中填寫你的手機號碼--%>
    飛信密碼:
    <input id="MyPassword" type="Password" value="changeme"/><%--value中填寫你的飛信號密碼--%>
    對方號碼:
    <select id="SelectOtherPhone">
    <option value="15895663693">自己測試</option>
    <option value="139********">老婆</option>
    <option value="135********">老爸</option>
    <option value="159********">老媽</option>
    </select>
    <br />
    短信內容:
    <textarea style="300px" rows="5" id="Content">祝自己開心~~</textarea>
    <br />
    <input id="Confirm" type="button" value="Send" onclick="return Confirm_onclick()" />
    </div>
    </form>
    </body>
    </html>
  • 相关阅读:
    LaTeX技巧22:LaTeX文档中的参考文献初级
    latex 三个不同的图放在一行且每个图都有注释
    CTeX学习心得总结
    latex不能识别eps图片
    山东大学《运筹学》课程课件
    高级算法设计讲义 Lecture Notes for Advanced Algorithm Design
    《计算复杂性》课件
    全球知名大学课件下载地址汇总
    用LaTeX写线性规划
    有感北大校长王恩哥的十句话
  • 原文地址:https://www.cnblogs.com/takako_mu/p/1728533.html
Copyright © 2011-2022 走看看