<!--#include file=conn.asp-->
<!--#include file=cookies.asp-->
<!--#include file="../inc/function.asp"-->
<title>修改分类</title>
<%
dim rs,sql,class1,class2,paixu,classid,leibie
classid=trim(request("classid"))
class1=request("class1")
class2=HtmlEncode(trim(request("class2")))
paixu=trim(request("paixu"))
if class1="" then
response.write "<li>错误，类别为空！"
call cl()
response.end
end if
if class2="" then
response.write "<li>错误，类别为空！"
call cl()
response.end
end if
if paixu="" then
response.write "<li>错误，类别为空！"
call cl()
response.end
end if
set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from [class2] where id="&cstr(classid)
rs.open sql,conn,1,3
leibie=trim(rs("class2"))
if class2=leibie then
rs("paixu")=paixu
rs.update
response.write "排序修改成功！"
call cl()
response.end
end if

if rs.eof then
response.write "参数错误！"
call cl()
else
rs("class1")=class1
rs("class2")=class2
rs("paixu")=paixu
rs.update
response.write "修改成功！！"
call cl()
end if
rs.close
set rs=nothing
closedb
%>
<%sub cl()%>
<body onLoad="setTimeout(window.close, 2000)">
<%end sub%>