postmsg.asp
上传用户:comthink
上传日期:2021-05-06
资源大小:1280k
文件大小:3k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

HTML/CSS

  1. <!-- #include file="conn.asp" -->
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <html>
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  6. <title>postmsg</title>
  7. <style type="text/css">
  8. <!--
  9. body {
  10. background-color: #CCCCFF;
  11. }
  12. table {
  13. font-size: 13px;
  14. font-weight: lighter;
  15. color: #000000;
  16. text-decoration: none;
  17. border: thin outset #99CC66;
  18. }
  19. input {
  20. font-size: 12px;
  21. font-weight: lighter;
  22. color: #000000;
  23. text-decoration: none;
  24. background-color: #CCCCFF;
  25. height: auto;
  26. border: thin inset #000000;
  27. cursor: hand;
  28. }
  29. select {
  30. font-size: 12px;
  31. font-weight: lighter;
  32. color: #000000;
  33. text-decoration: underline;
  34. background-color: #CCCCFF;
  35. border: thin inset #99CC66;
  36. cursor: crosshair;
  37. }
  38. -->
  39. </style>
  40. <script language="JavaScript" type="text/JavaScript">
  41. <!--
  42. function MM_openBrWindow(theURL,winName,features) { //v2.0
  43.   window.open(theURL,winName,features);
  44. }
  45. //-->
  46. </script>
  47. </head>
  48. <body topmargin="0"  leftmargin="0">
  49. <table width="100%" height="58" border="0">
  50.  
  51.   <tr>
  52.     <td height="25" colspan="2"><form action="postmsg.asp?ac=addmsg&myself=<%=request.querystring("myself")%>" method="post" name="form1" >
  53.   你对
  54.   <select name="rname">
  55.   <option>大家</option>
  56.   <%
  57.   '显示在线人数
  58.   set rsout=Server.CreateObject("ADODB.RecordSet")
  59. sqlout="select  * from  online  where id ORDER BY id DESC"
  60. rsout.open sqlout,conn,1,1
  61. for i=1 to 50 step 1
  62. %>
  63.      <option><%response.Write(rsout("username"))%></option>
  64. <%
  65.  rsout.movenext
  66.     if rsout.EOF Then Exit For
  67. next
  68. %>
  69.   
  70.   </select>
  71.   说:
  72.   <input name="msg" type="text" size="30">
  73.   <input name="Submit" type="submit" value="提交发言" height="15">  
  74.   <input name="username"  type="hidden" id="username" value="<%response.write(request.querystring("myself"))%>">
  75.   &nbsp;</form></td>
  76.   </tr>
  77.    <tr>
  78.     <td width="602" height="25"> </td>
  79.     <td width="185"> </td>
  80.   </tr>
  81. </table>
  82. </body>
  83. </html>
  84. <%
  85.           ac=request.QueryString("ac")
  86.            if ac="addmsg" then
  87.           set rs=server.createobject("adodb.recordset")
  88.           sql="select * from ip363net where id is null"
  89.           rs.open sql,conn,1,3  
  90.           rs.addnew
  91.           rs("username")=request.Form("username")
  92.   rs("rname")=request.form("rname")
  93.           rs("msg")=request.form("msg")
  94.           rs("gif")=request.Form("gif")
  95.           rs("posttime")=time()
  96.           rs.update
  97.           set rs=nothing
  98.   
  99. '当聊天数据大于15条时删除最久的数据   
  100.   
  101.  set rsck=server.CreateObject("adodb.recordset")
  102.  sqlck="select  * from  ip363net  where id ORDER BY id"
  103.  rsck.open sqlck,conn,1,1
  104.  nu=rsck.recordcount
  105.  b=rsck("id")
  106.   if nu>35  then
  107.  set rsold=server.CreateObject("adodb.recordset")
  108.   sqldell="delete * from ip363net where id="&b&""
  109.           rsold.open sqldell,conn,1,3
  110. end if
  111.           end if
  112. %>