📄 txlsms.asp
字号:
<!--#include file="top.asp"-->
<%
txlfl=trim(request("txlfl"))
msg=trim(request("msg"))
if request("action")="add" then
if msg="" then
response.write "<script>alert('对不起,短信内容不能为空!');history.go(-1);</Script>"
Response.End
end if
if txlfl="" then
set rs=server.createobject("adodb.recordset")
sql="select * from es_smstxl where es_id="&session("id")&" order by es_date desc"
rs.open sql,conn,1,1
mtsl=rs.recordcount
else
set rs=server.createobject("adodb.recordset")
sql="select * from es_smstxl where es_id="&session("id")&" and es_sort="&txlfl&" order by es_date desc"
rs.open sql,conn,1,1
mtsl=rs.recordcount
end if
sql2="select * from es_smsuser where es_id="&session("id")
set rs2=server.createobject("ADODB.Recordset")
rs2.open sql2,conn,1,1
pay=rs2("es_pay")
rs2.close
set rs2=nothing
if mtsl>pay then
response.write"<script>alert('余额不足 请先充值');window.open('pay.asp','_self');</script>"
response.end
else
do while not rs.eof
phone=rs("es_tel")
'---------------------发送短信-----------------------------
set objHttp = CreateObject("Microsoft.XMLHTTP")
strurl="http://sms.wuxicity.com/sms/333.asp?phone="&phone&"&msg="&msg&""
objHttp.Open "get",strURL,false
objHttp.setrequestheader "content-length",len(stra)
objHttp.send
zt=objHttp.responseText
'---------------------保存发送记录-----------------------------
userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR")
'将发送内容记录到数据库
set rs1=server.createobject("adodb.recordset")
sql1="select * from es_smsmt"
rs1.open sql1,conn,1,3
rs1.addnew
rs1("es_id")=id
rs1("es_msg")=msg
rs1("es_phone")=phone
rs1("es_zt")=zt
rs1("es_ip")=userip
rs1("es_td")=mt
rs1.update
rs1.close
set rs1=nothing
if zt=0 then
'从会员帐户扣除费用
conn.execute("update es_smsuser set es_pay=es_pay-1 where es_id="&id)
end if
rs.movenext
loop
rs.close
end if
response.write"<script>alert('提交"&mtsl&"条记录成功 请查看发件箱');window.open('mt.asp','_self');</script>"
response.end
end if
%>
<%usertopview%>
<script LANGUAGE=JavaScript>
function textLimitCheck(thisArea, maxLength){
if (thisArea.value.length > maxLength){
alert(maxLength + ' 个字限制. \r超出的将自动去除.');
thisArea.value = thisArea.value.substring(0, maxLength);
thisArea.focus();
}
/*回写span的值,当前填写文字的数量*/
messageCount.innerText = thisArea.value.length;
}
</script>
<table width="760" height="100%" border="0" align="center" cellPadding="0" cellSpacing="0" bgcolor="#ffffff">
<tr>
<td width="160" valign=top bgcolor=#efefef>
<!--==============-->
<!--#include file="left.asp"-->
<!--==============-->
</td>
<td width="600" align="left" valign=top>
<!--==============-->
<table border="0" width="100%">
<form name="from1" method="post" action="txlsms.asp?action=add"> <tr>
<td>
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0" style="border:1px #cccccc solid;" id="table1">
<%sql1="select * from es_smsuser where es_id="&session("id")
set rs1=server.createobject("ADODB.Recordset")
rs1.open sql1,conn,1,1%>
<tr>
<td width="358" height=33 background="img/tt2.gif"> <font color=black>自写短信</font></td>
</tr>
<tr>
<td bgcolor=#ffffff height=25>
<!--======-->
<table width="80%" border="0" cellspacing="0" cellpadding="0" align=center id="table2">
<tr>
<td width="28%" height="30" align=right>
<p align="left"><font color=red>*手机号码: </font></td>
<td width="72%" valign="middle"><p style="line-height:180%">
<select name="txlfl">
<option value="" selected>请选择组</option>
<%
sql="select * from es_smstxlfl where es_id="&session("id")&" order by es_date desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,1
while not rs.eof%>
<option value="<%=rs("id")%>"><%=rs("es_sort")%></option>
<%rs.movenext
wend
rs.Close()
%>
</select><br>默认为发送通讯录全部号码,选择后则只发送对应组的号码.</td>
</tr>
<tr>
<td width="28%" height="120" align=right>
<p align="left"><font color=red>*短信内容: </font></td>
<td><p style="line-height:180%">
<textarea name="msg" cols=40 rows=5 onkeyUp="textLimitCheck(this, 70);"></textarea>
<br><font color=#666666>限 70 个字符 已输入 <font color="#CC0000">
<span id="messageCount">0</span></font> 个字</font></td>
</tr>
<tr>
<td align=left width="28%" valign="top">
<p align="left"><font color=red>*说明:</font></td>
<td width="72%" align="left" valign="top"><font color="#0000FF">
试试在网上给手机发短信吧,很方便的。</font>
</td>
</tr>
<tr>
<td height=30 align="center" colspan="2" rowspan="2">
<input type="submit" name="Submit" value="发 送" class="input1"></td>
</tr> </table>
<!--======-->
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<!--==============-->
</td>
</tr>
</table>
<!--====== bottom ========-->
<!--====== bottom ========-->
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border:0px #cccccc solid;">
<tr>
<td width="30%" align="right" valign="middle"><img src="../images/index_04.gif" alt=""></td>
<td width="70%" align="left"><%=citybottom%></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -