📄 newsclass.asp
字号:
<!--#include file="../Comm/subconn.asp"-->
<%
username=request("username")
id=request("id")
action=request("action")
dim cls
if session("admin")="" then
Response.Redirect("admin.asp")
else
if session("flag")<>"0" then
cls = Instr(session("flag"), "news")
if cls <= 0 then
%>
<script language="javascript">
if (confirm("您的操作权限不够,系统拒绝你的访问,请点确定返回,或者点取消退出重新登录"))
location.href="admin.asp";
else
location.href="quit.asp";
</script>
<%
end if
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="admin.css" type="text/css">
<title>编辑新闻分类</title>
<style type="text/css"><!--
a:link {color: #FFFFFF;text-decoration: none;}
a:visited {color: #FFFFFF;text-decoration: none;}
a:hover {color: #FFFF99;text-decoration: underline;}
.b{color:#cccc99;font-size:10pt;border:dotted 1px}
--></style>
<SCRIPT LANGUAGE="JavaScript">
<!--
function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked;
}
}
//-->
</SCRIPT>
</head>
<body topmargin="20" bgcolor="#336699" text=#ffffff>
<table border="0" cellpadding="2" cellspacing="5" style="border-collapse: collapse" bordercolor="#222222" width="760" height="150" bgcolor="#336699" align="center">
<tr><td width=125 valign="top">
<!--#include file="admin_left.asp"-->
</td><td valign="top">
<table border="1" cellpadding="2" cellspacing="4" style="border-collapse: collapse" bordercolor="#222222" width="100%">
<tr>
<td width="100%">当前位置:<a href="admin.asp">网站管理中心</a>--编辑新闻分类</td>
</tr>
<tr>
<td width="100%">
<%if action="" then
Set rs = conn.Execute("select * from shopsetup")
%>
<table width="580" border="1" style="border-collapse: collapse; border-style: dotted; border-width: 1px" bordercolor="#333333" cellspacing="2" cellpadding="2" align="center">
<form action=newsclass.asp method=post name=setup>
<tr><td colspan=2 width="568" ><font color=yellow>编辑新闻分类名称</font></td></tr>
<tr><td width=155 align=right>新闻分类1 </td><td width="405"> <input type=text value="<%=rs("newstitle1")%>" name="newstitle1" size=30 maxlength="15"></td></tr>
<tr><td width=155 align=right>新闻分类2 </td><td width="405"> <input type=text value="<%=rs("newstitle2")%>" name="newstitle2" size=30 maxlength="15"></td></tr>
<tr><td width=155 align=right>新闻分类3 </td><td width="405"> <input type=text value="<%=rs("newstitle3")%>" name="newstitle3" size=30 maxlength="15"></td></tr>
<tr><td width=155 align=right>新闻分类4 </td><td width="405"> <input type=text value="<%=rs("newstitle4")%>" name="newstitle4" size=30 maxlength="15"></td></tr>
<tr><td width=155 align=right>新闻分类5 </td><td width="405"> <input type=text value="<%=rs("newstitle5")%>" name="newstitle5" size=30 maxlength="15"></td></tr>
<tr><td colspan=2 width="568" ><INPUT name=action TYPE="submit" value=" 更新 "></td></tr>
</form></table>
<%
rs.close
conn.close
set rs=nothing
set conn=nothing
end if%>
<%
if action=" 更新 " then
Set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from shopsetup"
rs.open sql,conn,1,3
rs("newstitle1")=request.form("newstitle1")
rs("newstitle2")=request.form("newstitle2")
rs("newstitle3")=request.form("newstitle3")
rs("newstitle4")=request.form("newstitle4")
rs("newstitle5")=request.form("newstitle5")
if rs("newstitle1")="" then
response.write "<script language='javascript'>"
response.write "alert('第一个新闻类别名称不能为空');"
response.write "location.href='javascript:history.go(-1)';"
response.write "</script>"
end if
rs.update
url="admin_news.asp"
rs.close
set rs=nothing
response.write "<script language='javascript'>"
response.write "alert('新闻分类更新成功!');"
response.write "location.href='"&url&"';"
response.write "</script>"
end if%>
</td></tr>
</table>
</td></tr>
</table>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -