AddNewNote.asp
上传用户:jisenq
上传日期:2014-06-29
资源大小:7216k
文件大小:7k
源码类别:

数据库编程

开发平台:

ASP/ASPX

  1. <% Option Explicit %>
  2. <!--#include file="../../FS_Inc/Const.asp" -->
  3. <!--#include file="../../FS_InterFace/MF_Function.asp" -->
  4. <!--#include file="../../FS_InterFace/ns_Function.asp" -->
  5. <!--#include file="../../FS_Inc/Function.asp" -->
  6. <%
  7. response.buffer=true
  8. Response.CacheControl = "no-cache"
  9. Dim Conn,User_Conn
  10. MF_Default_Conn
  11. 'session判断
  12. MF_Session_TF 
  13. if not MF_Check_Pop_TF("WS002") then Err_Show
  14. %>
  15. <html>
  16. <HEAD>
  17. <TITLE>FoosunCMS留言系统</TITLE>
  18. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  19. </HEAD>
  20. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  21. <body>
  22. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
  23.   <tr class="hback">
  24.     <td align="left" colspan="2" class="xingmu">留言板&nbsp;<a href="../../help?Lable=Message" target="_blank" style="cursor:help;'" class="sd"><img src="../Images/_help.gif" border="0"></a></td>
  25.   </tr>
  26.   <tr>
  27.     <td colspan="2" class="hback"><a href="ClassMessageManager.asp">管理首页</a></td>
  28.   </tr>
  29. </table>
  30. <form id="WriteNote" name="WriteNote" action="?Act=Add" method="post">
  31. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
  32. <tr class="hback">
  33. <td class="hback" align="right" width="20%">贴子标题</td>
  34. <td class="hback" ><input type="test" name="Topic" size="20" maxlength="50">&nbsp;&nbsp;<input type="checkbox" id="IsAdmin" name="IsAdmin" value="1">公管理员可见</td>
  35. </tr>
  36. <tr class="hback">
  37. <td class="hback" align="right" width="20%">贴子类型</td>
  38. <td class="hback" align="left"><input type="radio" name="Style" value="1">推荐帖子<input type="radio" name="Style" value="0" checked>普通帖子</td>
  39. </tr>
  40. <tr>
  41. <td class="hback" align="right" height="25">表情</td>
  42. <td class="hback" ><table width="100%" border="0" cellspacing="0" cellpadding="0">
  43.                   <tr> 
  44.                     <td> <input name="FaceNum" type="radio" value="1" checked> 
  45.                       <img src="Images/face1.gif" width="22" height="22"> </td>
  46.                     <td> <input type="radio" name="FaceNum" value="2"> <img src="Images/face2.gif" width="22" height="22">                    </td>
  47.                     <td> <input type="radio" name="FaceNum" value="3"> <img src="Images/face3.gif" width="22" height="22">                    </td>
  48.                     <td> <input type="radio" name="FaceNum" value="4"> <img src="Images/face4.gif" width="22" height="22">                    </td>
  49.                     <td> <input type="radio" name="FaceNum" value="5"> <img src="Images/face5.gif" width="22" height="22">                    </td>
  50.                     <td> <input type="radio" name="FaceNum" value="6"> <img src="Images/face6.gif" width="22" height="22"></td>
  51.                     <td> <input type="radio" name="FaceNum" value="7"> <img src="Images/face7.gif" width="22" height="22">                    </td>
  52.                     <td> <input type="radio" name="FaceNum" value="8"> <img src="Images/face8.gif" width="22" height="22">                    </td>
  53.                     <td> <input type="radio" name="FaceNum" value="9"> <img src="Images/face9.gif" width="22" height="22"></td>
  54.                   </tr>
  55.                   <tr> 
  56.                     <td> <input type="radio" name="FaceNum" value="10"> <img src="Images/face10.gif" width="22" height="22"></td>
  57.                     <td> <input type="radio" name="FaceNum" value="11"> <img src="Images/face11.gif" width="22" height="22">                    </td>
  58.                     <td> <input type="radio" name="FaceNum" value="12"> <img src="Images/face12.gif" width="22" height="22"></td>
  59.                     <td> <input type="radio" name="FaceNum" value="13"> <img src="Images/face13.gif" width="22" height="22">                    </td>
  60.                     <td> <input type="radio" name="FaceNum" value="14"> <img src="Images/face14.gif" width="22" height="22"></td>
  61.                     <td> <input type="radio" name="FaceNum" value="15"> <img src="Images/face15.gif" width="22" height="22"></td>
  62.                     <td> <input type="radio" name="FaceNum" value="16"> <img src="Images/face16.gif" width="22" height="22"></td>
  63.                     <td> <input type="radio" name="FaceNum" value="17"> <img src="Images/face17.gif" width="22" height="22">                    </td>
  64.                     <td> <input type="radio" name="FaceNum" value="18"> <img src="Images/face18.gif" width="22" height="22">                    </td>
  65.                   </tr>
  66.                 </table>
  67. </td>
  68. </tr>
  69. <tr class="hback">
  70. <td class="hback" align="right">帖子内容</td>
  71.         <td class="hback" valign="top" ><textarea name="Content" id="Content" rows="8" cols="25"></textarea></td>
  72. </tr>
  73. <tr class="hback">
  74. <td class="hback">&nbsp;<input type="hidden" name="ClassID" ID="ClassID" value="<%=Request.querystring("ClassID")%>"></td>
  75.   <td class="hback"><input type="submit" name="submit" value="OK发表贴子">&nbsp;&nbsp;
  76.     <input type="reset" name="reset" value=" 清  空 "></td>
  77. </tr>
  78. </table>
  79. </form>
  80. <%
  81. dim ClassID,NoteRs,Topic,Content,Face,IsUser,isTop,IsAdmin,strShowErr
  82. Set NoteRs=Server.CreateObject(G_FS_RS)
  83. if NoSqlHack(Request.QueryString("Act"))="Add" then
  84. ClassID=NoHtmlHackInput(Request.form("ClassID"))
  85. Topic=NoHtmlHackInput(trim(Replace(Request.form("Topic"),"'","")))
  86. IsTop=NoHtmlHackInput(trim(Request.form("Style")))
  87. Content=NoHtmlHackInput(Trim(Request.form("Content")))
  88. IsAdmin=NoHtmlHackInput(Trim(Request.form("IsAdmin")))
  89. if IsAdmin="" then
  90. IsAdmin="0"
  91. end if
  92. if ClassID="" then
  93. strShowErr = "<li>参数出错!</li>"
  94. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  95. Response.end
  96. end if
  97. if Topic="" then
  98. strShowErr = "<li>标题不能为空!</li>"
  99. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  100. Response.end
  101. end if
  102. if isTop="" then
  103. strShowErr = "<li>帖子类型值没传过来!</li>"
  104. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  105. Response.end
  106. end if
  107. if Content="" then
  108. strShowErr = "<li>内容不能为空!</li>"
  109. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  110. Response.end
  111. end if
  112. NoteRs.open "Select ClassID,User,Topic,Body,AddDate,IsTop,State,Style,IsAdmin,Hit,LastUpdateUser,Face,IP from FS_WS_BBS where 1=2",Conn,1,3
  113. NoteRs.Addnew
  114. NoteRs("ClassID")=ClassID
  115. NoteRs("User")=session("Admin_Name")
  116. NoteRs("Topic")=Topic
  117. NoteRs("Body")=Content
  118. NoteRs("AddDate")=now()
  119. NoteRs("IsTop")=IsTop
  120. NoteRs("Style")="普通"
  121. NoteRs("IsAdmin")=IsAdmin
  122. NoteRs("Face")=Request.Form("FaceNum")
  123. NoteRs("LastUpdateUser")=session("Admin_Name")
  124. NoteRs("IP")=Request.ServerVariables("REMOTE_ADDR")
  125. NoteRs.update
  126. Set NoteRs=nothing
  127. strShowErr = "<li>发帖成功</li>"
  128. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=bbs/ClassMessageManager.asp")
  129. Response.end
  130. end if
  131. Response.end
  132. Set Conn=nothing
  133. %>
  134. </body>
  135. </html>