网络寻呼机数据库版处理发送消息SubmitMessage.asp
发布时间:2006-10-14 2:59:46   收集提供:gaoqian
<%
  word=request("word")
  toname=request("userid")
  name=session("username")
  
  '检验输入的字节是否大于200
    
    if len(trim(word))>200  then
    response.write("你输入的字节大于200,请<a href=javascript:history.back()>返回</a>")
    response.end
    end if
    
    '不能给自己发信息
    if name=toname then
    response.write("不能给自己发信息,请<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
   
    
    
    '检验输入的字节是否和上次一样
    
    
    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("发送的信息不能和上一次一样,请<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>

 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50