附:原始碼3:BBSSENDINFO.ASP

來源:互聯網
上載者:User
原始碼 <%@ 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>



聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.