Deal_bbs.asp
Upload User: pengwei803
Upload Date: 2021-02-10
Package Size: 3311k
Code Size: 1k
Development Platform:

HTML/CSS

  1. <!--#include file="../Ku_inc/Ku_sql.asp"-->
  2. <!--#include file="../Ku_inc/Ku_config.asp"-->
  3. <!--#include file="Ku_conn.asp"-->
  4. <!--#include file="../Ku_inc/inc.asp"-->
  5. <!-- #include file="Session.asp"-->
  6. <%
  7. if request("action")="add" then
  8. name=Checkin(trim(Request.form("mingcheng")))
  9.     If name="" Then
  10.     Response.Write "<script>alert(""分类名称不能为空!"");location.href=""javascript:history.back()"";</script>"
  11.     Response.end()
  12.     end if
  13.     set rs=server.createobject("adodb.recordset")
  14.     sql="select * from ku_bbskind where name='"&name&"'"
  15.     rs.open sql,conn,1,3
  16.     if (rs.eof and rs.bof) then
  17.     rs.addnew
  18.     rs("name")=name
  19.     rs.update
  20.     rs.close
  21.     response.Write("<script>alert(""添加成功!"");location.href=""bbs_kind.asp"";</script>")
  22.     else
  23.     response.Write("<script>alert(""分类已存在!"");location.href=""bbs_kind.asp"";</script>")
  24.     end if
  25.     end if 
  26. %>
  27. <%
  28. if request("action")="edit" then
  29. name=Checkin(trim(Request.form("mingcheng")))
  30. id=request("id")
  31.     If name="" Then
  32.     Response.Write "<script>alert(""分类名称不能为空!"");location.href=""javascript:history.back()"";</script>"
  33.     Response.end()
  34.     end if
  35.     set rs=server.createobject("adodb.recordset")
  36.     sql="select * from ku_bbskind where id="&id
  37.     rs.open sql,conn,1,3
  38.     
  39.     rs("name")=name
  40.     rs.update
  41.     rs.close
  42.     response.Write("<script>alert(""修改成功!"");location.href=""BBs_kind.asp"";</script>")
  43.     end if 
  44. %>