明輝手游網(wǎng)中心:是一個(gè)免費(fèi)提供流行視頻軟件教程、在線學(xué)習(xí)分享的學(xué)習(xí)平臺(tái)!

網(wǎng)絡(luò)尋呼機(jī)數(shù)據(jù)庫(kù)版處理發(fā)送消息SubmitMessage.asp

[摘要]<% word=request("word") toname=request("userid") name=session("username") '檢驗(yàn)輸入的字節(jié)是否大于200 if len(tr...
<%
  word=request("word")
  toname=request("userid")
  name=session("username")
  
  '檢驗(yàn)輸入的字節(jié)是否大于200
    
    if len(trim(word))>200  then
    response.write("你輸入的字節(jié)大于200,請(qǐng)<a href=javascript:history.back()>返回</a>")
    response.end
    end if
    
    '不能給自己發(fā)信息
    if name=toname then
    response.write("不能給自己發(fā)信息,請(qǐng)<a href=javascript:history.back()>返回</a>")
    response.end
    end if
    
set conn=server.createobject("adodb.connection")
    Provider = "Provider=Microsoft.Jet.OLEDB.4.0;"
    DBPath = "Data Source=" & Server.MapPath( "webuser.mdb" )

    conn.Open Provider & DBPath
   
    
    
    '檢驗(yàn)輸入的字節(jié)是否和上次一樣
    
    
    sql="select top 1 word,adddate from talks where fromname='"& name & "' and toname='"& toname &"'order by adddate desc"
    set rs=conn.execute(sql)
    
    if not rs.eof then
    
       myword=rs("word")
          
       if word=myword  then
       
          response.write("發(fā)送的信息不能和上一次一樣,請(qǐng)<a href=javascript:history.back()>返回</a>")
          rs.close
          set rs=nothing
          response.end
        end if
     end if
    
    set Rs=server.createobject("adodb.recordset")
    sql1="select * from talks"
    rs.open sql1,conn,3,2
    rs.addnew
    rs("fromname")=name
    rs("toname")=toname
    rs("word")=word
    rs.update
    
    

%>
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>保存信息</title>
<script language=javascript>
function close_win(){
window.close();
}
function autoclose(){
window.setTimeout("close_win()",0);}
autoclose();
</script>
</head>

<body>

</body>

</html>