class_edit_save.asp

来自「欢迎使用《雨点下载系统 2.0》! 本系统仅提供给个人网站免费使用」· ASP 代码 · 共 40 行

ASP
40
字号
<!--#include file="conn.asp"-->
<!--#include file="chkadmin.asp"-->
<!--#include file="inc/char.asp"-->
<%dim id,ClassName
id=Cint(Trim(Request.Form("id")))
ClassName=Trim(Request.Form("ClassName"))

dim errmsg,founderr
founderr=false

if chkadmin=true and power(5)="0" then
	founderr=true
	errmsg=errmsg+"<li>您没有修改分类的权限</li>"
end if

if ClassName="" then
	founderr=true
	errmsg=errmsg+"<li>类别名称不能为空</li>"
elseif strlen(ClassName)>20 then
	founderr=true
	errmsg=errmsg+"<li>类别名称应在20个字符内</li>"
end if

if founderr=false then
	conn.execute("update Class set ClassName='"&ClassName&"' where ID="&id)
	dim sql,rs
	sql="select ParentID from Class where ID="&id
	set rs=conn.execute(sql)
	dim gourl,msg
	gourl="class_list.asp?id="&rs(0)
	msg="分类修改成功!"
	set rs=nothing
	call ok()
else
	call error()
end if

conn.close
set conn=nothing
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?