原始碼 <%@ Language=VBScript %>
<%
users=split(application("OnlineUser"), ",", -1) '分割得到當前線上使用者的列表,儲存到一個數組中
If trim(request("act"))="wantsend" then '判斷目前的操作狀態
who=trim(Request.Form("who")) '得到被呼叫使用者名稱稱
content=trim(Request.Form("content")) '得到呼叫內容
meme=trim(request("userid")) '得到發送傳呼的使用者名稱稱
If who="" or content="" then
Response.Redirect "bbsmsg.asp?msg=姓名或者訊息內容為空白,無法傳送!"
end if
'下面將發送的資訊送至傳呼資訊隊列當中.
If trim(application("Message"))="" then
Application.Lock
application("Message")=who & "$" & content & "$" & meme '放置到傳呼資訊隊列當中
Application.UnLock
else
Application.Lock ''放置到傳呼資訊隊列當中
application("Message")=application("message") & "&" & who & "$" & content & "$" & meme
Application.UnLock
end if
'發送完畢,關閉頁面
'Response.Write "<script language=javascript>self.close();</script>"
Response.Redirect "bbsmsg.asp?msg=完成了!"
end if
%>
<html>
<title>網路傳呼機</title>
<head>
<script language="javascript">
function check()
{
if(document.send.content.value.length<1)
{
alert("您必須要說兩句喔!");
return;
}
document.send.action="bbsSendBegin.asp?act=wantsend&userid=<%=trim(session("userid"))%>";
document.send.submit();
}
</script>
</head>
<body bgcolor=GhostWhite >
<br>
<center>
網 絡 傳 呼 機
</center>
<br>
<%if Ubound(users)>=1 then%>
<center>
<form name="send" method="post">
<table>
<tr>
<td>送訊息給:</td>
<!-- 得到當前線上使用者的列表,並放到下拉式清單方塊中 -->
<td>
<select name="who">
<%For i=0 to ubound(users)%>
<%If trim(users(i))<>trim(meme) then%>
<%if i>1 then
if users(i)<>users(i-1) then%>
<option><%=users(i)%>
<%end if
else
if users(i)<>meme then%>
<option><%=users(i)%>
<%end if
end if
end if
Next%>
</select>
</td>
</tr>
<tr>
<td>訊息內容:</td>
<td>
<input type="text" name="content" si