WEB开发网
开发学院WEB开发ASP 网络寻呼机数据库版处理发送消息SubmitMessage.as... 阅读

网络寻呼机数据库版处理发送消息SubmitMessage.asp

 2001-12-03 11:06:04 来源:WEB开发网   
核心提示:<%Word=request("word")toname=request("userid")name=session("username")'检验输入的字节是否大于200if len(trim(word))>200then response
<%
 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>

Tags:网络 寻呼机 数据库

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接