⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smssend.asp

📁 机票预定系统 各个模块的设计-ticket reservation systems detailed design system modules of the design
💻 ASP
字号:
<!--#include file="include/conn.asp"-->
<!--#include file="../client_infor.asp"-->
<!--#include file="CheckSystem.asp"-->
<%
SetLimit=session("Limit")
call checklimit(SetLimit,"1")'调用验证管理员权限的函数
response.Clear()
%>
<%
'以下是发送短信处理:
smt=request.form("smt")
if smt="OK" then
	mobile=trim(request.form("mobile"))
	infor=trim(left(request.form("infor"),230))
	if mobile="" or infor="" then
		response.write "<script>alert('你提交的信息不全,请返回');window.history.back();</script>"
		response.end
	else
	%>
	<%
'Option Explicit
Dim objHttpRequest	'XML文档对象

'根据参数,生成调用URL,因为是测试例子,不对变量为空的情况做处理
URL = "http://"&SmsUrl&"/SDK/Sms_Send.asp?CorpID="&ComId&"&LoginName="&SmsName&"&send_no="&mobile&"&Timer="&request("Timer")&"&msg="&Server.URLEncode(infor)&"&passwd="&SmsPw


'调用MSXML,发送请求
set objHttpRequest = CreateObject("MSXML2.ServerXMLHTTP" )
if objHttpRequest is Nothing Then
 '返回错误
 response.write "create Msxl2.ServerXMLHTTP error"
 response.end
end if

'发出请求
objHttpRequest.open "GET",URL,False
objHttpRequest.send()
if objHttpRequest.status <> 200  then
 '返回错误
 response.write "Open Request Error"
 response.end
end if

'取返回信息,并且分析
retMsg = objHttpRequest.responseText

Ret   = left(retMsg,InStr(retMsg,",")-1)
iRet  = Cint(Ret)

if iRet>0  then  '判断是否发送成功
    SendID = right(retMsg,len(retMsg)-InStr(retMsg,","))
	SendSmsResult="发送短信成功"
else
	SendSmsResult="发送短信失败"
end if
'释放资源
Set objHttpRequest = Nothing
%>
	<%
	end if
end if
%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>后台管理机票系统</title>
<link rel="stylesheet" type="text/css" href="style/comm.css" />
<link rel="stylesheet" type="text/css" href="style/skin0.css" />
<style type="text/css">
<!--
.red {color: #FF0000}
-->
</style>
</head>
<SCRIPT language=javascript>
<!--

function checkinput()
{
if (ZXLform.mobile.value==""){
	alert("请输入手机号");
	ZXLform.mobile.focus();
	return false;
}
if (ZXLform.Infor.value=="")
	{
	  alert("内容不能为空!");
	  ZXLform.Infor.focus();
	  return false; 
}
if (ZXLform.mobile.value != ""){
	if (!IsMobile(ZXLform.mobile.value)){
		alert("你输入的手机号不符合实际格式,请检查");
		ZXLform.mobile.focus();
		return false;
	}
}

  return true; 	
		//-->
}
function ChangeMyInfor(){
	ZXLform.Infor.value=ZXLform.MyInfor.value;
}
function ChangeContact(){
	ZXLform.mobile.value=ZXLform.Contact.value;
}
function IsMobile(str){
	var strer=/^0{0,1}1(3[0-9]{1}|59)[0-9]{8}$/;
	Arrstr=str.split(";");
	for (i=0;i<Arrstr.length;i++){
		if (strer.test(Arrstr[i]))
			return true;
		else{
			return false;
			break;
			}
	}
}

</SCRIPT>
<body class="tbody">
<div class="txt_title">发送短信息 </div>
<div class="settingtable onesizeI">&nbsp;</div>
<div id="masterdiv" class="settingtable onesizeI">

<span class="submenu" id="settingtable1">
  <table width="95%" border="0" cellspacing="0" cellpadding="12" align="center">
    <tr>
      <td colspan="2" style="padding:0;"><div class="addr_line addr_line_top">给用户发送手机短信息<span class="txt_title">
         <%if request("MobileType")="" then response.Write("<a href=?MobileType=1>从会员中提取手机号</a>") else response.Write("<a href=?MobileType=>从常用联系人中提取手机号</a>") end if%>
      </span></div></td>
    </tr>
  </table>
  <table width="95%" border="0" align="center" cellpadding="4" cellspacing="0" class="settingtable">
   <form name="ZXLform" method="post" action="SmsSend.asp" onSubmit="return checkinput();">
    <tr class="normal black" >
      <td colspan="3" style="text-align:right;">&nbsp;	  </td>
      </tr>   
    <tr class="normal black" >
      <td width="109" style="text-align:right;">接收手机号:</td>
      <td width="349"><input name="mobile" type="text" class="txt" id="mobile" value="<%=mobile%>" size="28" maxlength="130" />
      <%
			if request("MobileType")="1" then
			sql="select Mem_Name,Mem_Mobile from Tmember where Mem_Mobile<>'' order by Mem_ID desc"
			else
			sql="select Mem_Name,Mem_Mobile from SmsContact order by id desc"
			end if
			set rs=server.createobject("adodb.recordset")
			rs.open sql,conn,1,1
			%>
              <select name="Contact" onChange="ChangeContact()">
                <option value="">请选择联系人</option>
                <%if not rs.eof then
				do while not rs.eof 
			%>
                <option value="<%=rs("Mem_Mobile")%>"><%=rs("Mem_Name")%></option>
                <%
				rs.movenext
				loop
			end if
			rs.close
			%>
        </select></td>
      <td width="453" rowspan="3"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="2%" valign="top"><span class="red">*</span></td>
          <td width="98%">多个手机号请用“<span class="red">;</span>”隔开。最多可以输入10个手机号;</td>
        </tr>
        <tr>
          <td valign="top"><span class="red">*</span></td>
          <td>短信平台带反骚扰监控系统,不允许短时间内向同一手机号码发送过多短信。默认设置为20分钟内不允许向同一号码发送超过2条相同内容的短信;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><span class="red" style="font-size:14px;"><%=SendSmsResult%>
          </span></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><span class="red" style="font-size:14px;"><%=SmsStatus%></span></td>
        </tr>
      </table>
	  </td>
    </tr>
    <tr class="normal black" >
      <td width="109" style="text-align:right;">自定义短信:</td>
      <td><%
			sql="select top 50 infor,flagstr from SmsInfor order by id desc"
			set rs=server.createobject("adodb.recordset")
			rs.open sql,conn,1,3
			%>
			<select name="MyInfor" onChange="ChangeMyInfor()">
			<option value="">请选择</option>
			<%if not rs.eof then
				do while not rs.eof 
			%>
				<option value="<%=rs("infor")%>"><%=rs("flagstr")%></option>
			<%
				rs.movenext
				loop
			end if
			rs.close
			set rs=nothing
			conn.close
			set conn=nothing
			%>
			</select></td>
      </tr>
    <tr class="normal black" >
      <td width="109" style="text-align:right;">信息内容:</td>
      <td><textarea name="Infor" cols="15" rows="4" id="Infor" style="width:322"><%=infor%></textarea></td>
      </tr>
    <tr class="normal black" >
      <td width="109" style="text-align:right;">&nbsp;</td>
      <td colspan="2">
	  <input type="hidden" name="smt" value="OK">
      <input type="submit" name="AddNow" value=" 确认发送 "> &nbsp;
	  <input type="button" value=" 返回上页 " name="CancelRow"  onClick="javascript:window.history.back();">	  </td>
    </tr>
    <tr class="normal black" >
      <td colspan="3" style="text-align:right;">&nbsp;	  </td>
      </tr> 
	</form>
  </table>
</span>


</div>


</body>
</html>




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -