📄 dgsave.asp
字号:
<!--#include file="up.asp"-->
<!--#include file="dgconn.asp"-->
<%dim isfull
isfull=false
membername=request.cookies(cn)("lgname")
if membername="" then
error2("客人不可以查看点歌列表,请您登陆或者注册!")
response.end
end if
%><br><table cellpadding=3 cellspacing=1 border=0 align=center >
<tr>
<th><a href=dglistall.asp><b>所有点歌列表</b></a></th>
<th><a href=dglistme.asp><b>我的点歌列表</b></a></th>
<th><a href=dgwrite.asp><b>我要点歌</b></a></th>
</tr>
<tr>
<td align=center valign=middle colspan="3">点手歌曲祝福你的好友</td>
</tr>
</table>
<br>
<%
dim lincept,lcontent,lmedianame,lurl
lincept=replace(Request.Form("incept"),"'","")
lcontent=replace(Request.Form("content"),"'","")
lmedianame=replace(Request.Form("medianame"),"'","")
lurl=Request.Form("url")
if lincept="" then
error2("请输入接收用户名")
else
if instr(lincept,"全体会员")>0 then
lincept="全体会员"
isfull=true
else
lincept=split(lincept,"|")
if ubound(lincept)>=5 then
error2("最多只能发送给5个用户")
end if
end if
end if
if lmedianame="" then
error2("请输入歌曲名")
end if
if lurl="" or lurl="http://" then
error2("请正确输入音乐地址")
end if
if lcontent="" then
error2("请输入祝福语")
end if
if len(lmedianame)>50 then '--------------判断名字
error2("歌曲名不能多于50字")
end if
if len(lcontent)>200 then '--------------判断名字
error2("祝福语不能多于200字")
end if
dim haverr '是否有不存在的用户
haverr=false
call updata()
call success()
'===================================
sub updata()
dim ii
if isfull then
set rs=server.createobject("adodb.recordset")
sql="select * from media"
rs.open sql,connDG,3,2
rs.addnew
rs("sender")=membername
rs("incept")=lincept
rs("sendtime")=now()
rs("content")=lcontent
rs("medianame")=lmedianame
rs("url")=lurl
rs.update
rs.close
set rs=nothing
%>
<script language="vbscript">
msgbox "点歌祝福已成功发出!你向论坛所有的会员发送了点歌祝福"
</script>
<%else
for ii=0 to ubound(lincept)
set rs=server.createobject("adodb.recordset")
sql="select name from user where name='"&lincept(ii)&"'"
rs.open sql,myconn,1,1
if rs.eof and rs.bof then
error2("论坛没有["&lincept(ii)&"]这个用户")
haverr=true
else
rs.close
sql="select * from media"
rs.open sql,connDG,3,2
rs.addnew
rs("sender")=membername
rs("incept")=lincept(ii)
rs("sendtime")=now()
rs("content")=lcontent
rs("medianame")=lmedianame
rs("url")=lurl
rs.update
rs.close
set rs=nothing
dim sender,title,body
sender=membername
title="送给您的祝福"
body="[color=green]"&[membername]&"[/color] 点了一首歌 [color=navy]"&lmedianame&"[/color] 给你!"&chr(10)&"祝福语:[color=blue]"&lcontent&"[/color] "&chr(10)&"[B][URL=dglistme.asp]点击这里查看点歌[/URL][/B]"
sql="insert into hand(name,neirong,riqi,tname,isnew)values('"&sender&"','"&body&"',now(),'"&lincept(ii)&"',0)"
myconn.execute(sql)
%>
<script language="vbscript">
msgbox "点歌祝福已成功发出!系统已向[<%=lincept(ii)%>]发出短消息通知"
</script>
<% end if
next
end if
end sub
sub success()
%>
<table cellpadding=3 cellspacing=1 border=0 align=center >
<tr>
<th colspan="2" width="100%"><b>点歌发送情况</b></th>
</tr>
<tr>
<td width="100%" class=tablebody1><%if haverr then%><b>操作结果:</b><br><br>失败!<%else%><b>操作成功:</b><br><br>恭喜!<%end if%></td>
</tr>
<tr align="center">
<td width="100%" >
<a href="javascript:history.go(-1)"> << 返回上一页</a>
</td>
</tr>
</table>
<%
end sub
%>
<%sub error2(message)
%><script>alert('<%=message%>');history.back();</script><script>window.close();</script>
<%response.end
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -