⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_web.asp

📁 完整的网址站
💻 ASP
字号:
<!--#include file="config.asp"-->
<%
dim founderr,errmsg
founderr=false
errmsg=""
if session("adminlogin")<>sessionvar then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你尚未登录,或者超时了!请<a href='index.asp'>重新登录</a>!"
  call diserror()
  response.end
end if
  if session("flag")>1 then
  errmsg=errmsg+"<br>"+"<li>你的管理权限不够!!</a>!"
  call diserror()
  response.end
  end if

%>
<script id=clientEventHandlersJS language=javascript>
<!--
function CheckForm()
{
if (document.form.title.value==""){
alert("网站标题不能为空!");
document.form.Name.focus();
return false;
}
if (document.form.url.value==""){
alert("网站地址不能为空!");
document.form.HomePage.focus();
return false;
}
}-->
</script>
<html>
<head>
<title>管理中心</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
</head>
<body LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0"><script>if(top==self)top.location="index.asp" </script>
<%
action=Request("action")
title=Request("title")
url=Request("url")
n=5
if Request("action")="del" then

if Request("id")="" then
response.write"<SCRIPT language=JavaScript>alert('没有该网址,或者该网址已经删除。!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
conn.execute "delete * from happywz_URL where id=" & Request("id")

response.write"<SCRIPT language=JavaScript>alert('网址删除成功,返回!');"
response.write"location.href='admin_web.asp?n="&Request("n")&"'</SCRIPT>"
response.end
end if
if Request("action")="editd" then
set r=server.createobject("adodb.recordset")
		r.open "select * from happywz_URL where id="&Request("id"),conn,1,3
		if not r.eof then
			r("title")=title
			r("url")=url
			r.update
			r.close
set r=nothing
response.write"<SCRIPT language=JavaScript>alert('网址修改成功,返回!');"
response.write"location.href='admin_web.asp?n="&Request("n")&"'</SCRIPT>"
response.end
end if
end if
if Request("action")="edit" then

if Request("id")="" then
response.write"<SCRIPT language=JavaScript>alert('没有该网址,或者该网址已经删除。!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
set r=server.createobject("adodb.recordset")
r.open "select * from happywz_URL where id="&Request("id"),conn,1,3
if not r.eof then
%>
<br>
<form action="admin_web.asp" method="get">
<table width="96%"  border="1" align="center" cellpadding="1" cellspacing="0" bordercolor="#0099CF" style="border-collapse: collapse">
  <tr>
    <td height="30" colspan="2" bgcolor="#0099CF"><div align="center">修改网址</div></td>
  </tr>
    <tr bgcolor="#FFFFFF">
    <td width="25%">网址ID:</td>
    <td width="75%"><input name="id" id="id" value="<%=r("id")%>" disabled>
	<input name="id" value='<%=r("id")%>' type='hidden'>
	<input name="n" value='<%=Request("n")%>' type='hidden'>
	</td>	
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width="25%">网址标题:</td>
    <td width="75%"><input name="title" id="title" value="<%=r("title")%>"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>网址url:</td>
    <td><input name="url" id="url" value="<%=r("url")%>" size="35"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td colspan="2"><div align="center">
        <input type="hidden" name="action" value="editd">
        <input name="submit" type="submit" style="FONT-SIZE: 9pt" value="确认修改">
    </div></td>
  </tr>
</form>
</table>
<%
end if
Response.End
end if
if action="add_wz" then
	if title="" or url="" then
		errmsg="<li>表单填写不完整!!"
call diserror()	
Response.End
	end if
	if Session("lastaddedwz")<>title then
		set rss=server.createobject("adodb.recordset")
		rss.open "select * from happywz_URL",conn,1,3
		rss.addnew
		rss("title")=title
		rss("url")=url
		rss("space")=n
		rss.update
		rss.close
		set rss=nothing
		Session("lastaddedwz")=title
		response.write"<SCRIPT language=JavaScript>alert('网站信息已经提交成功!');"
response.write"location.href='admin_web.asp?n="&n&"'</SCRIPT>"
response.end
	end if
end if
%>
<div align="center"><br>
</div>
<form name="form" method="post" action="" onSubmit="return CheckForm()">
<table width="96%"  border="1" align="center" cellpadding="1" cellspacing="0" bordercolor="#0099CF" style="border-collapse: collapse">
<form name="form" method="post" action="" onSubmit="return CheckForm()">
  <tr>
    <td height="30" colspan="2" bgcolor="#0099CF"><div align="center"><font color="#FFFFFF">添加导航条</font></div></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td width="25%">网站标题:</td>
    <td width="75%"><input name="title" id="title"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>网站url:</td>
    <td><input name="url" id="url" value="http://" size="35"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td colspan="2"><div align="center">
        <input type="hidden" name="action" value="add_wz">
        <input name="submit" type="submit" style="FONT-SIZE: 9pt" value="添加">
    </div></td>
  </tr>
</form>
</table>
<table width="96%" border="1" align="center" cellpadding="1" cellspacing="0" bordercolor="#0099CF" bgcolor="#FFFFFF" style="border-collapse: collapse">
  <tr bgcolor="#0099CF">
    <td height="25" colspan="4"><div align="center"><font color="#FFFFFF">导航条列表</font></div></td>
 
  </tr>
  <tr>
    <td width="6%"><div align="center">编号</div></td>
    <td width="33%"><div align="center">名称</div></td>
    <td width="38%"><div align="center">地址</div></td>
    <td width="23%"><div align="center"></div>
    <div align="center">操作</div></td>
  </tr>
  <%
set r=server.createobject("adodb.recordset")
r.open "select * from happywz_URL where space="&n&" order by id",conn,1,3
do while not r.eof 
  %> <tr>
    <td><div align="center"><%=r("id")%></div></td>
    <td><div align="center"><a href="<%=r("url")%>" target="_blank"><%=r("title")%></a></div></td>
    <td><div align="center"><a href="<%=r("url")%>" target="_blank"><%=r("url")%></a></div></td>
    <td><div align="center"><a href="admin_web.asp?id=<%=r("id")%>&action=edit&n=<%=n%>">修改</a> <a href="admin_web.asp?id=<%=r("id")%>&action=del&n=<%=n%>">删除</a></div></td>
  </tr>
  <%
r.movenext
loop
if r.eof and r.bof then
%>
  <tr>
    <td colspan="4"><div align="center">当前没有导航条!</div></td>
  </tr>
</table><br><%end if%>
<br>
</BODY>
</HTML>

⌨️ 快捷键说明

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