ClassAdd.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. 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. <script language="javascript">
  22. function checknum(obj){
  23. if (isNaN(obj.value)){
  24. alert("格式不对!");
  25. obj.value="0";
  26. obj.focus();
  27. }
  28. }
  29. </script>
  30. <body>
  31. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table"> 
  32.   <tr> 
  33.     <td align="left" colspan="2" class="xingmu">留言系统分类管理&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../help?Lable=Message" target="_blank" style="cursor:help;'" class="sd"><img src="../Images/_help.gif" border="0"></a></td> 
  34.   </tr>
  35.   <tr>
  36.    <td ><a href="ClassManager.asp">管理首页</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="ClassAdd.asp">添加栏目</a></td>
  37.   </tr>
  38.  </table>
  39. <form name="ClassAdd" action="?Act=Add" method="post">
  40. <table width="98%" border="0" align="center" cellpadding="4" cellspacing="1" class="table"> 
  41. <tr>
  42. <td class="hback" width="10%">栏目名称</td>
  43. <td class="hback" width="90%"><input type="text" name="ClassName" size="40">
  44. <font color="red"> *</font></td>
  45. </tr>
  46. <tr>
  47. <td class="hback">栏目说明</td>
  48. <td class="hback"><input type="text" name="ClassExp"  size="40">
  49. <font color="red"> *</font></td>
  50. </tr>
  51. <tr>
  52. <td class="hback">栏目排序</td>
  53. <td class="hback"><input name="pid" type="text" onKeyUp="checknum(this)" value="0" size="40">
  54.   <font color="red">*</font>(数字越大,栏目排序越靠前)</td>
  55. </tr>
  56. <tr>
  57. <td class="hback">&nbsp;</td>
  58. <td class="hback"><input type="Submit" name="sumbit" value="添加">&nbsp;&nbsp;<input type="Reset" name="reset" value="重置"></td>
  59. </tr>
  60. </table>
  61. </form>
  62. <%
  63. Dim ClassName,ClassExp,Pid,strShowErr
  64.  If NoSqlHack(Request.QueryString("Act"))="Add" Then
  65.   ClassName=NoHtmlHackInput(trim(Replace(Request.form("ClassName"),"'","")))
  66. ClassExp=NoHtmlHackInput(Trim(Replace(Request.form("ClassExp"),"'","")))
  67. Pid=trim(Request.Form("pid"))
  68. If ClassName="" Then
  69. strShowErr = "<li>栏目名称不能为空!</li>"
  70. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  71. Response.end
  72. End If
  73. if not Isnumeric(Pid) then
  74. strShowErr = "<li>栏目排序填写不对!</li>"
  75. Response.Redirect("../error.asp?ErrCodes="&Server.URLEncode(strShowErr)&"")
  76. Response.end
  77. else
  78. Pid=iNT(AbS(Pid))
  79. end if
  80. Conn.execute("Insert into FS_WS_Class(ClassID,ClassName,ClassExp,Pid,Author) values('"&GetRamCode(15)&"','"&ClassName&"','"&ClassExp&"','"&Pid&"','"&session("Admin_Name")&"')")
  81. strShowErr = "<li>添加成功</li>"
  82. Response.Redirect("../Success.asp?ErrCodes="&Server.URLEncode(strShowErr)&"&ErrorUrl=BBS/ClassManager.asp")
  83. Response.end
  84.  End If
  85.  Set Conn=nothing
  86. %>
  87. </body>
  88. </html>