<%@ language=vbscript %>
<%
id=trim(request.querystring("userid")) 得到当前的用户名称,就是自己(等于session("userid"))
if request.querystring("act")="send" then 获取当前的操作状态
who=trim(request.form("who")) 如果是发送状态,就获取发送到的用户名称
content=trim(request.form("content")) 如果是发送状态,就获取发送的内容
if who="" or content="" then
response.redirect "error.asp?msg=姓名或者讯息内容为空,无法传送!"
end if
因为&,$是传呼信息区的分割符号,所以要过滤掉这些字符,不允许用户输入这些字符
if instr(1,who,"&")>=1 or instr(1,who,"$")>=1 or instr(1,content,"&")>=1 or instr(1,content,"$")>=1 then
response.redirect "error.asp?msg=姓名或者讯息内容包含非法字符($/&),无法传送!"
end if
if trim(application("message"))="" then
application.lock 将传呼信息放到传呼信息队列当中
application("message")=who & "$" & content & "$" & trim(request.querystring("userid"))
application.unlock
else
application.lock 将传呼信息放到传呼信息队列当中
application("message")="&" & who & "$" & content & "$" & trim(request.querystring("userid"))
application.unlock
end if
response.write "<script language=javascript>self.close()</script>"
response.end
else
**************************
开始分析处理"传呼信息队列",取得属于自己的传呼信息
if trim(application("message"))<>"" then
msg=split(application("message"),"&") 分割得到传呼信息区,并保存到数组
for i=0 to ubound(msg)
if instr(1,trim(msg(i)),trim(request.querystring("userid")))>=1 then
mymsg=split(msg(i),"$") 分割得到每个传呼信息区的详细信息
if trim(mymsg(0))=trim(request.querystring("userid")) then 这条传呼信息是发给我的!
msgok=1 有人呼叫我的表记置为1
from=trim(mymsg(2)) 获得传呼的详细内容
content=trim(mymsg(1))
sendto=trim(mymsg(0))
end if
end if
next
end if
****************************
end if
%>
<html>
<title>网络传呼机</title>
<head>
<script language="javascript">
function nosend()
{
document.frmmail.action="bbssendinfo.asp?act=wait&userid=<%=trim(request.querystring("userid"))%>"
document.frmmail.submit();
}
function meclose()
{
document.frmmail.action="bbssendinfo.asp?act=closeme&userid=<%=session("userid")%>"
document.frmmail.submit();
}
function destory()
{
<% if trim(request("act"))="closeme" then
cancelme=trim(request.querystring("userid")) & "$" & content & "$" & trim(from)
application.lock
application("message")=replace(application("message"),cancelme,"")
application.unlock %>
self.close()
<% end if%>
}
function chkok()
{
if (document.frmmail.content.value=="")
{
alert("您不能说\"空话\"喔!");
return;
}
document.frmmail.submit();
}
</script>
</head>
<body bgcolor="ghostwhite" onload="javascript:destory();" topmargin="0">
<br>
<form name="frmmail" action="bbssendinfo.asp?act=send&userid=<%=trim(request.querystring("userid"))%>" method="post">
<table border="0" width="200" align="center" cellspacing="1" cellpadding="1">
<tr>
<td colspan="2" align="center">嘻嘻,有人呼你喔…
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td nowrap><%=from%>说:</td>
<td><%=content%></td>
</tr>
<tr>
<td nowrap>回覆内容:</td>
<td><input name="content" size="34" maxlength="35"></td>
</tr>
</table>
<br><br>
<center>
<a href="javascript:chkok();"><img src="send.gif" border="0"></a>
<a href="javascript:document.frmmail.reset()"><img src="renew.gif" border="0"></a>
<a href="javascript:meclose();"><img src="exit.gif" border="0"></a>
<input name="who" type="hidden" value="<%=from%>">
</center>
</body>
</html>
