?? admin_web.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>你的管理權(quán)限不夠!!</a>!"
call diserror()
response.end
end if
%>
<script id=clientEventHandlersJS language=javascript>
<!--
function CheckForm()
{
if (document.form.title.value==""){
alert("網(wǎng)站標(biāo)題不能為空!");
document.form.Name.focus();
return false;
}
if (document.form.url.value==""){
alert("網(wǎng)站地址不能為空!");
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('沒有該網(wǎng)址,或者該網(wǎng)址已經(jīng)刪除。!');"
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('網(wǎng)址刪除成功,返回!');"
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('網(wǎng)址修改成功,返回!');"
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('沒有該網(wǎng)址,或者該網(wǎng)址已經(jīng)刪除。!');"
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">修改網(wǎng)址</div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="25%">網(wǎng)址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%">網(wǎng)址標(biāo)題:</td>
<td width="75%"><input name="title" id="title" value="<%=r("title")%>"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>網(wǎng)址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="確認(rèn)修改">
</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('網(wǎng)站信息已經(jīng)提交成功!');"
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">添加導(dǎo)航條</font></div></td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="25%">網(wǎng)站標(biāo)題:</td>
<td width="75%"><input name="title" id="title"></td>
</tr>
<tr bgcolor="#FFFFFF">
<td>網(wǎng)站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">導(dǎo)航條列表</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">當(dāng)前沒有導(dǎo)航條!</div></td>
</tr>
</table><br><%end if%>
<br>
</BODY>
</HTML>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -