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

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

开发平台:

HTML/CSS

  1. <!--#include file="conn.asp"-->
  2. <!-- #include file="inc/const.asp" -->
  3. <!-- #include file="inc/chkinput.asp" -->
  4. <%
  5. dim titleimg,title,content,toptitle
  6. dim signflag,mailflag
  7. dim rootid
  8. if request("rootid")="" then
  9. foundErr=true
  10. Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
  11. elseif not isInteger(request("rootid")) then
  12. foundErr=true
  13. Errmsg=Errmsg+"<br>"+"<li>非法的贴子参数。"
  14. else
  15. rootID=request("rootid")
  16. end if
  17. titleimg=Checkstr(Request.Form("Expression"))
  18. title=Checkstr(trim(request.Form("subject")))
  19. content=Checkstr(trim(request.form("Content")))
  20. realname=Checkstr(trim(request.Form("realname")))
  21. if memberword=trim(request.Form("password")) then
  22. PassWord=Checkstr(trim(request.Form("password")))
  23. else
  24. PassWord=md5(Checkstr(trim(request.Form("password"))))
  25. end if
  26. if signflag="yes" then
  27. signflag=1
  28. else
  29. signflag=0
  30. end if
  31. if mailflag="yes" then
  32. mailflag=1
  33. else
  34. mailflag=0
  35. end if
  36. if chkpost=false then
  37. ErrMsg=ErrMsg+"<Br>"+"<li>您提交的数据不合法,请不要从外部提交发言。"
  38. FoundErr=True
  39. end if
  40. if realName="" or PassWord="" then
  41. realname=membername
  42. PassWord=memberword
  43. end if
  44. if realName="" then
  45. ErrMsg=ErrMsg+"<Br>"+"<li>请输入您的姓名。"
  46. FoundErr=True
  47. end if
  48. if strLength(title)>50 then
  49. foundErr=True
  50. ErrMsg=ErrMsg+"<Br>"+"<li>主题长度不能超过50"
  51. end if
  52. if request("method")="Topic" then
  53. if title="" then
  54. if content="" then
  55. ErrMsg=ErrMsg+"<Br>"+"<li>主题和内容必须填写其一。"
  56. foundErr=True
  57. end if
  58. end if
  59. end if
  60. if request("method")="fastreply" then
  61. if content="" then
  62. ErrMsg=ErrMsg+"<Br>"+"<li>快速回复请填写发言内容。"
  63. foundErr=True
  64. end if
  65. end if
  66. if strLength(content)>Clng(txl_set(22)) then
  67. ErrMsg=ErrMsg+"<Br>"+"<li>发言内容不得大于" & CSTR(txl_set(22)) & "bytes"
  68. FoundErr=true
  69. end if
  70. if content="" then
  71. ErrMsg=ErrMsg+"<Br>"+"<li>没有填写内容。"
  72. foundErr=true
  73. end if
  74. 'start
  75. if founderr then
  76. stats="错误信息"
  77. call head()
  78. call head_var("","")
  79. call txl_error()
  80. else
  81. stats="回复帖子成功"
  82. call head()
  83. call head_var("班级论坛","b_index.asp")
  84. call main()
  85. if founderr then call txl_error()
  86. end if
  87. call foot()
  88. sub main()
  89. if Cint(txl_set(14))=1 then
  90. Errmsg=Errmsg+"<br>"+"<li>班级论坛已经被管理员限制了不允许发帖。"
  91. founderr=true
  92. exit sub
  93. end if
  94. sql="select islock,Lastuser,title from topic where topicid="&cstr(rootid)
  95. set rs=conn.execute(sql)
  96. if not rs.eof and not rs.bof then
  97. toptitle=rs(2)
  98. if not master and rs("islock")=1 then
  99. Errmsg=ErrMsg+"<Br>"+"<li>本主题已经锁定,不能发表回复。"
  100. founderr=true
  101. exit sub
  102. end if
  103. end if
  104. set rs=nothing
  105. '*******************
  106. rem 保存贴子信息
  107. sql="insert into bbs (rootid,postuser,postuserid,titleimg,title,content,addtime,isbest,signflag,emailflag) values ("&rootid&",'"&realname&"',"&userid&",'"&titleimg&"','"&title&"','"&content&"',now(),0,"&signflag&","&mailflag&")"
  108. conn.execute(sql)
  109. sql="update topic set replys=replys+1,LastTime=Now(),lastuser='"&realname&"' where TopicID="&rootID
  110. conn.execute(sql)
  111. conn.execute("update [user] set bbscount=bbscount+1,usermoney=usermoney+"&txl_user(3)&" where userid="&userid)
  112. %>
  113. <meta http-equiv=refresh content="3;URL=b_show.asp?id=<%=rootid%>">
  114. <table width="<%=txl_body(0)%>" cellpadding="0" cellspacing="0" align="center" style="border:1px <%=txl_body(9)%> solid; border-top-width: 0px; border-right-width: 1px; border-bottom-width: 0px; border-left-width: 1px;">  
  115. <tr> 
  116. <td  bgcolor=<%=txl_body(10)%>><br>
  117. <table cellpadding=3 cellspacing=1 align=center class=tableborder1 style="width:75%">
  118. <tr align=center>
  119. <th width="100%">状态:<%=stats%></th>
  120. </tr>
  121. <tr>
  122. <td width="100%" class=tablebody1>本页面将在3秒后自动返回班级你所发表的话题,<b>您可以选择以下操作:</b><br><ul>
  123. <li><a href="index.asp">返回首页</a></li>
  124. <li><a href="b_index.asp">班级论坛</a></li>
  125. <li><a href="b_show.asp?id=<%=rootid%>">您所发表的帖子</a></li>
  126. </ul></td>
  127. </tr>
  128. </table>
  129. <br>
  130. </td>
  131. </tr>
  132. </table>
  133. <%
  134. end sub
  135. %>