📄 sms.asp
字号:
<!--#include file="top.asp"-->
<!--#include file="../inc/md5.asp"-->
<%
if request("action")="save" then
'--------------------取数据-----------------------------
pay=int(request("pay"))
id=session("id")
phone=request("phone")
msg=trim(request("msg"))
phone= Split(phone,chr(13), -1, 1)
'------------------------------------------------------------
if pay=<UBound(phone) then
response.write"<script>alert('余额不足');window.open('pay.asp','_self');</script>"
response.end
else
for i=0 to UBound(phone)
'---------------------发送短信-----------------------------
set objHttp = CreateObject("Microsoft.XMLHTTP")
strurl="http://demosms.wuxicity.com/sms/send.asp?phone="&phone(i)&"&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 rs=server.createobject("adodb.recordset")
sql="select * from es_smsmt"
rs.open sql,conn,1,3
rs.addnew
rs("es_id")=session("id")
rs("es_msg")=msg
rs("es_phone")=phone(i)
rs("es_zt")=zt
rs("es_ip")=userip
rs.update
rs.close
set rs=nothing
if zt=0 then
'从会员帐户扣除费用
conn.execute("update es_smsuser set es_pay=es_pay-1 where es_id="&id)
end if
next
end if
response.write"<script>alert('提交成功 请查看发件箱记录');window.open('mt.asp','_self');</script>"
response.end
end if
%>
<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>
<%usertopview%>
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
<tr>
<td width="189" valign=top bgcolor=#efefef>
<!--==============-->
<!--#include file="left.asp"-->
<!--==============-->
</td>
<td width="585" align="center" valign=top>
<!--==============-->
<table width="534" border="0" cellspacing="0" cellpadding="0" align="center">
<tr><td height=25>您现在的位置是:管理中心 > 群发短信</td></tr>
<tr>
<td>
<!--####################################-->
<table cellSpacing="0" cellPadding="0" width="100%" align="center" border="0" style="border:1px #cccccc solid;">
<%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 colspan="2" 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>
<form name="addform" method="POST" action="sms.asp?action=save" onSubmit="return checkdata()">
<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%">
<textarea rows="5" name="phone" cols="33"></textarea><br>每行为一个号码,回车换行.号码最后请不要回车,<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);"><%=request("msg")%></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"><%if rs1("es_pay")<1 then%><font color="#FF0000" size="4">您已经欠费,请交费后再发送 </font><% else %><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><%end if%>
<input type="hidden" name="pay" value="<%=rs1("es_pay")%>">
</form>
</table>
<!--======-->
</td>
</tr>
</table>
<!--####################################-->
</td>
</tr>
<tr><td height=25>
</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 + -