<%@ 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"))