talk_votedeal.asp
上传用户:stone001
上传日期:2016-10-28
资源大小:685k
文件大小:3k
源码类别:

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

开发平台:

ASP/ASPX

  1. <!--插入html头部分以及数据库接口-->
  2. <!--#include file="in_conn.asp"-->
  3. <!--插入时间id的函数-->
  4. <!--#include file="in_idtime.asp"-->
  5. <!--获取发布内容字数限制-->
  6. <!--#include file="in_talksize.asp"-->
  7. <body>
  8. <!--插入网站置顶-->
  9. <% if u_name="" then
  10. Response.Redirect "log_err.asp"
  11. else
  12. %>
  13. <!--#include file="in_topmb.asp"-->
  14. <% end if %>
  15. <%
  16. '判断用户权限
  17. IF u_power=0 THEN
  18. Response.Redirect "resp.asp?cmd=id_wait"
  19. ELSEIF u_power<0 THEN
  20. Response.Redirect "resp.asp?cmd=id_forbid&time="&u_fobdate
  21. END IF
  22. %>
  23. <table align="center" width="700" height="50" border="0" cellspacing="0" cellpadding="11" class="rdkuang"><tr>
  24. <td width="100%" height="100%" align="center">
  25. <%
  26. '获取传值
  27. dim vtopic,vcontent
  28. dim vemo,vonly1
  29. vtopic=trim(Request.Form("txttopic"))
  30. vcontent=Request.Form("txtcontent")
  31. vemo=0
  32. vonly1=CBool(Request.Form("radonly1"))
  33. '检查正确性
  34. IF vtopic="" OR vcontent="" OR LEN(vtopic)>50 OR LEN(vcontent)>DEF_talksize*1024 THEN
  35. response.Redirect "resp.asp"
  36. END IF
  37. '检查投票选项
  38. dim opcount,opi
  39. dim str_option(9),opstr
  40. opcount=0
  41. For opi=1 to 10
  42. opstr=Request.Form("option"&opi)
  43. if opstr<>"" then
  44. str_option(opcount)=opstr
  45. opcount=opcount+1
  46. end if
  47. Next
  48. '检查选项是否大于2项
  49. if opcount<2 then
  50. Response.Redirect "resp.asp?cmd=vote2op"
  51. end if
  52. '检查是否重复发文
  53. dim cnt
  54. cnt=conn.Execute("SELECT COUNT(t_ID) FROM tbltalk WHERE t_topic='"&stryin(vtopic)&"' AND t_author='"&u_name&"' AND t_isreply=False",0,1)(0)
  55. if cnt<>0 then
  56. Response.Redirect "resp.asp?cmd=talk_repub"
  57. end if
  58. '处理时间
  59. dim vidfre
  60. dim vtdate
  61. vtdate=now()
  62. vidfre=idtime(vtdate)
  63. '插入数据
  64. sqlstr="INSERT INTO tbltalk(t_author,t_topic,t_content,t_datepub,t_isreply,t_class,t_idfre,t_owner,t_re,t_clk,t_emotion) VALUES('"&u_name&"','"&stryin(vtopic)&"','"&stryin(vcontent)&"',#"&vtdate&"#,False,1,"&vidfre&",'"&u_name&"',0,0,"&vemo&")"
  65. conn.Execute sqlstr
  66. '获得新记录的id
  67. dim vtid
  68. vtid=conn.Execute("SELECT t_ID FROM tbltalk WHERE t_idfre="&vidfre,0,1)(0)
  69. '插入选项
  70. sqlstr="INSERT INTO tblvote(v_topicID,v_voter,v_enable,v_only1,v_option) VALUES("&vtid&",'"&u_name&"',false,"&vonly1&",'"
  71. For i=0 to opcount-1
  72. conn.Execute sqlstr&stryin(str_option(i))&"')"
  73. Next
  74. '更新你的发水量
  75. sqlstr="UPDATE tblmates SET cnt_water=cnt_water+1 WHERE ID="&u_ID
  76. conn.Execute sqlstr
  77. %>
  78. 恭喜:发表主题成功!
  79. <table align="center" width="400" height="25" border="0">
  80. <tr><td>
  81. 请选择接下来的操作:<font color="red">(系统在3秒后将自动转向您刚发表的投票主题)</font>
  82. <br><a href="voteview.asp?id=<% =vtid %>"><img src="img/icn_go.gif" border="0">返回您刚发表的投票主题</a>
  83. <br><a href="talkbook.asp"><img src="img/icn_go.gif" border="0">返回[班级讨论区]</a>
  84. <br><a href="index.asp"><img src="img/icn_go.gif" border="0">返回首页</a>
  85. </td></tr>
  86. </table>
  87. </td>
  88. </tr></table>
  89. <script defer language="javascript">
  90. setTimeout('location.href="voteview.asp?id=<% =vtid %>"',3000);
  91. </script>
  92. <br>
  93. <!--插入在线统计-->
  94. <!--#include file="in_online.asp"-->
  95. <!--插入网站置底-->
  96. <!--#include file="in_bottom.asp"-->
  97. </body>
  98. </html>