?? send.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 + -