📄 save_bignews.asp
字号:
<!--#include file="conn.asp"-->
<%call time_out()%>
<%
if instr(session("proview"),"s3")=0 then
response.Write "<script language=javascript>alert('您无权操作!');window.location.href='index.asp';</script>"
response.end
end if%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<%
action=trim(request("action"))
typeid=trim(request("typeid"))
select case action
case "add"
if trim(request("news_type"))="" then
response.Write "<script language=javascript>alert('新闻类别不能为空!');window.location.href='bignews.asp';</script>"
response.end
end if
sql="select * from newsclass"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
rs("news_type")=triM(request("news_type"))
rs.update
rs.close
set rs=nothing
response.Redirect("bignews.asp")
'修改
case "edit"
sql="select * from newsclass where typeid="&typeid
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs("news_type")=triM(request("news_type"))
rs.update
rs.close
set rs=nothing
response.Redirect("bignews.asp")
'删除
case "del"
'判断是否可以删除
sql1="select typeid from news where typeid="&typeid
set rs=server.createobject("adodb.recordset")
rs.open sql1,conn,1,1
if not rs.eof then
response.Write "<script language=javascript>alert('新闻中有该分类信息,不可删除!');window.location.href='bignews.asp';</script>"
response.end
end if
rs.close
set rs=nothing
sql="select * from newsclass where typeid="&typeid
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.update
rs.close
set rs=nothing
response.Redirect("bignews.asp")
end select
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -