⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 send.asp

📁 yuanma
💻 ASP
字号:
<%
'fix text for SQL
Function SqlStr( data ) 
SqlStr = Replace( data, "'", "''" )
End Function 

'get info from client
No=request.QueryString("No")
tousr=SqlStr(request.form("senduser"))
words=SqlStr(request.form("sendwords"))

'connect to user database
Set Conn=Server.CreateObject("ADODB.Connection")
Connstr="DBQ="+server.mappath("user.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;ImplicitCommitSync=Yes;MaxBufferSize=512;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UserCommitSync=Yes;"
Conn.Open connstr

updated="yes"
temptext=""
goon=false
offline="no"
'user indetify
sql="SELECT * FROM 用户表 WHERE 在线编号='" & No & "'"
Set Rs=conn.Execute(sql)
if Rs.Bof OR Rs.Eof Then
  temptext="%0D你已掉线,请重新登录!%0D"
  offline="yes"
else
  fuser=Rs("用户名")
  goon=true
end if

if goon=true then
  'check reciever's state
  sql="SELECT * FROM 用户表 WHERE 用户名='" & tousr & "'"
  Set Rs=conn.Execute(sql)
  if Rs.Bof OR Rs.Eof Then
    temptext="%0D只能发消息给Flasher ICQ的注册用户,消息未能发出!%0D"
  else
    sql="INSERT INTO 信息池 ( 发信人, 收信人, 发信时间, 正文) VALUES( '" &_
	 fuser & "', '" & tousr & "', #" & now() & "#, '" & words & "')"
	conn.Execute(sql)
	toNo=Rs("在线编号")
    if toNo<>"0" then
	  temptext="%0D消息已发出,对方应在两分钟内收到。%0D"
    else
      temptext="%0D消息已发出,但对方已离线。%0D"
    end if
  end if

end if

Rs.close
set Rs=nothing
conn.close
set conn=nothing

' return
ReturnValue="updated=" & updated & "&temptext=" & temptext & "&offline=" & offline
response.write(ReturnValue)

%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -