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

数据库编程

开发平台:

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. Dim TellRs,Tellsql
  14. if not MF_Check_Pop_TF("WS002") then Err_Show
  15. %>
  16. <html>
  17. <HEAD>
  18. <TITLE>FoosunCMS</TITLE>
  19. <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
  20. <style type="text/css">
  21. <!--
  22. .style1 {font-weight: bold}
  23. .style2 {color: #FF0000}
  24. -->
  25. </style>
  26. </HEAD>
  27. <link href="../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
  28. <BODY>
  29.   <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
  30.     <tr>
  31.       <td align="left" colspan="2" class="xingmu">公告管理&nbsp;&nbsp;&nbsp;<a href="../../help?Lable=Message" target="_blank" style="cursor:help;'" class="sd"><img src="../Images/_help.gif" border="0"></a></td>
  32.     </tr>
  33. <tr class="hback">
  34.    <Td class="hback" colspan="4"><a href="NewTell.asp">返回</a></td>
  35.   </tr>
  36. </table>
  37. <form action="?Act=Add" method="post" name="Addform">
  38. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table">
  39. <tr>
  40. <td class="hback" width="10%" align="right">添 加 者</td>
  41. <td class="hback" width="80%"><input type="text" id="AddUser" name="AddUser" size="40" value="<%=Session("Admin_Name")%>" readonly></td>
  42. </tr>
  43. <tr>
  44. <td class="hback" align="right">公告标题</td>
  45.   <td class="hback"><input name="Topic" type="text" id="Topic" size="40" maxlength="50">
  46.     <font color="#FF0000">*必须填写项目</font></td>
  47. </tr>
  48. <tr>
  49. <td class="hback" align="right"> 内  容  </td>
  50.   <td class="hback"><textarea name="Content" cols="70" rows="7"></textarea>
  51.   <font color="#FF0000">*必须填写项目</font>
  52. <tr>
  53. <td class="hback" >&nbsp;</td>
  54.   <td class="hback">&nbsp;
  55.   <input type="submit" name="submit" value="保  存">   &nbsp;&nbsp;
  56.       <input type="reset" name="reset" value="重  置">
  57. </table>
  58. </form>
  59. <%
  60. Dim AddUser,Topic,Content,Person,AddRs,strShowErr
  61. Set AddRs=Server.createobject(G_FS_RS)
  62. if Request.querystring("Act")="Add" then
  63. AddUser=Request.form("AddUser")
  64. Topic=Request.form("Topic")
  65. Content=trim(Replace(Request.form("Content"),vbcrlf,"<br>"))
  66. Person=request.form("Person")
  67. if AddUser="" then 
  68. strShowErr = "<li>用户名为空,请检楂用户登陆是否已过期!</li>"
  69. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  70. Response.end
  71. end if
  72. if Topic="" then
  73. strShowErr = "<li>公告标题不能为空</li>"
  74. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  75. Response.end
  76. end if
  77. if Content="" then
  78. strShowErr = "<li>公告内容不能为空</li>"
  79. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  80. Response.end
  81. end if
  82. AddRs.open "Select Topic,Content,Person,AddUser,AddDate From FS_WS_NewsTell where 1=2",Conn,1,3
  83. AddRs.Addnew
  84. AddRs("Topic")=Topic
  85. AddRs("Content")=Content
  86. AddRs("Person")=Person
  87. AddRs("AddUser")=AddUser
  88. AddRs("AddDate")=now()
  89. AddRs.update
  90. Set AddRs=nothing
  91. strShowErr = "<li>添加成功</li>"
  92. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=BBS/NewTell.asp")
  93. Response.end
  94. end if
  95. Set Conn=nothing
  96. %>
  97. </body>
  98. </html>