www.gusucode.com > 共享世纪内容管理系统 2.1 build 080704 全站开源版 > admin/down_type_add.asp

    <%Admin="DownType"%>
<!--#include file="check.asp"-->
<!--#include file="mdb_path_down.asp"-->
<%
if request("id")<>"" then
  tname=""&request("tname")&""&request("tname_add")&"|"
else
  tname=""&request("tname_add")&"|"
end if

if request("id")<>"" then
  tj=request("tj")+1
else
  tj="1"
end if

if request("tname_add")="" then errmsg=errmsg & "<li>类别名不能为空!</li>"
Set rsc = Conn.Execute("select * from downtype where tname= '" & tname & "'")
if not rsc.eof then errmsg=errmsg & "<li>当前目录已有相同的类别名!</li>"
if errmsg<>"" then
    Conn.Close
    Set conn = nothing
    Set rsc = nothing
    response.write("" & errmsg & "<br><Br><A href='javascript:history.go(-1)' style='text-decoration: none'><<后退</a>")
    response.end
end if
set rst=server.CreateObject("ADODB.RecordSet")

			rst.open "select * from downtype",conn,3,2
			rst.addnew
			rst("tname")=tname
			if request("id")<>"" then
			  rst("tn")=request("id")
			end if
			rst("tj")=tj
			rst.update
			rst.close
			set rsedit=server.CreateObject("ADODB.RecordSet")
			rsedit.open "select * from downtype order by id desc",conn,1,3
			rsedit("ts")=""&request("ts")&""&rsedit("id")&","
			rsedit.Update
			rsedit.close
            response.redirect "down_sort.asp?id="&request("id")&""
set rst=nothing
conn.close
set conn=nothing%>