dim founderr,errmsg
founderr=false
errmsg=""
if session("adminlogin")sessionvar then
founderr=true
errmsg=errmsg+""+"你尚未登录,或者超时了!请重新登录!"
call diserror()
response.end
else
if Request.form("MM_insert") then
if request.Form("action")="newartcat" then
openarticle
sql="select * from a_cat"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim cat_name
cat_name=trim(replace(request.form("cat_name"),"'",""))
if cat_name="" then
founderr=true
errmsg=errmsg+""+"你必须填写文章分类名称!"
else
rs("cat_name")=cat_name
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
response.redirect "admin_article.asp"
end if
end if
if request.Form("action")="editartcat" then
if request.Form("id")="" then
founderr=true
errmsg=errmsg+""+"你必须指定操作的对象!"
else
if not isInteger(request.form("id")) then
founderr=true
errmsg=errmsg+""+"非法的文章分类id参数。"
end if
end if
if founderr then
call diserror()
response.End
end if
openarticle
sql="select * from a_cat where cat_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
cat_name=trim(replace(request.form("cat_name"),"'",""))
if cat_name="" then
founderr=true
errmsg=errmsg+""+"你必须填写文章分类名称!"
else
rs("cat_name")=cat_name
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
response.redirect "admin_article.asp"
end if
end if
if request.Form("action")="delartcat" then
if request.Form("id")="" then
founderr=true
errmsg=errmsg+""+"你必须指定操作的对象!"
else
if not isInteger(request.form("id")) then
founderr=true
errmsg=errmsg+""+"非法的文章分类id参数。"
end if
end if
if founderr then
call diserror()
response.End
end if
openarticle
sql="select * from a_cat where cat_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.close
set rs=nothing
response.redirect "admin_article.asp"
end if
end if
call admin_nav()
call adminarticle_body()
closedatabase
call adminendpage()
end if
%>