<% response.charset="gb2312" Chk_Admin_Login() Action=zhcx.CheckRequest(request("Action")) Select Case lcase(Action) Case "del" Call Del() Case "save" Call Save() Case else zhcx.ErrAlert("非法操作") end select Sub Del() Dim Id,pathhtml,class_Id Id=zhcx.checkstr(request("Id")) if Id="" then zhcx.ErrAlert("参数错误") end if For i=0 to ubound(split(Id,",")) Sql="Select Id,Img_Src From Z_Book where Id="&zhcx.checknumeric(split(Id,",")(i)) Set rs=zhcx.conn(sql) if not rs.eof then Img=trim(rs(1)) rs.delete end if rs.close set rs=nothing '删除文件 Call Del_file(Syspath&Img) Next Call zhcx.SuccHref("删除成功","Dir.asp","self") End Sub Sub Save() Id=zhcx.checknumeric(request("Id")) Title=zhcx.checkStr(request("Title")) autor=zhcx.checkStr(request("autor")) content=request("content") Hot=zhcx.checkStr(request("Hot")) Img_Src=zhcx.checkStr(request("Img_Src")) if Hot<>"" then Hot=1 else Hot=0 end if if Content<>"" then else zhcx.ErrAlert("内容不能为空") end if Sql="Select * From Z_Book where Id="&Id Set rs=zhcx.conn(sql) if not rs.eof then '修改 Str="修改成功" else Str="添加成功" rs.addnew rs("addTime")=Now end if rs("Title")=Title rs("autor")=autor rs("Hot")=Hot rs("Content")=Content rs("Img_Src")=Img_Src rs.update rs.close set rs=nothing Call zhcx.SuccHref(Str,"dir.asp","self") End Sub %>