📄 admin.asp
字号:
<!--#INCLUDE FILE="db_inc.asp"-->
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open StrConn
%>
<html>
<head>
<title>友情链接</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td></td>
</tr>
<tr>
<td width="674" bgcolor="#FFFFFF"><%if session("admin")="" then%>
<table width="74%" border="0" align="center" cellpadding="8" cellspacing="0">
<tr>
<td> <img src="images/Topics.gif" width="23" height="21" align="absmiddle"><b><font color="#999999">请输入管理员密码</font></b></td>
</tr>
</table>
<table width="74%" height="17" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#F5F5F5">
<form name="form1" method="post" action="admin.asp?action=login"><tr>
<td height="36" bgcolor="#F9F9F9"> Password:
<input type="password" name="adminpass">
<input type="submit" name="Submit" value="login...">
</td>
</tr></form>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p>
<%else%>
<br>
<%if request("action")="" then%>
</p>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><iframe id="datamain" src="adminlinks.asp" width=674 height=380 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no ></iframe>
<script LANGUAGE="JavaScript">
<!-- hide
function goHist(a) {
history.go(a);
}
//-->
</script></td>
</tr>
</table>
<%elseif request("action")="edit" then%>
<%
dim id
id=htmls(encodestr(request("id")))
StrSql = "select * from sogo_link where id="&id
Set rs = server.CreateObject("ADODB.RecordSet")
rs.Open StrSql,Conn,1,1
if rs.eof then
response.write"<script>alert('很抱歉,没有您所需要的数据!~`');</script>"
response.write "<script>history.go(-1);</script>"
response.End()
else
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#FFFFFF"><table width=86% align=center border=0 cellpadding=0 cellspacing=1 bgcolor=#FF9900><tr><td bgcolor=#FFFFFF>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#F3F3F3">
<form action="?action=editok&id=<%=id%>" method="post">
<script language=javascript>
function confirm_button(){
if (confirm("真的要删除吗,添加上去很辛苦的呢,考虑一下吧?")){
return true;
}
return false;
}
</script>
<tr bgcolor="#FF9900">
<td height="30" colspan="2"><font color="#FFFFFF"><font color="#FFFFFF"> »
<b>修改友情链接</b></font>[<b><%=rs("sogo_link_font")%></b>] </font></td>
</tr>
<tr>
<td width="92" align="right"> <br>
网站名称: </td>
<td width="385"><br> <input name="t1" type="text" id="t13" value="<%=rs("sogo_link_font")%>"></td>
</tr>
<tr>
<td align="right">链接类型: </td>
<td width="385"><label>
<input name="logoortxt" type="radio" value="0" checked>
图片链接</label> <label>
<input type="radio" name="logoortxt" value="1">
文字链接</label> </td>
</tr>
<tr>
<td align="right"> 连接地址: </td>
<td><input name="t2" type="text" id="t23" value="<%=rs("sogo_link_url")%>" size="60"></td>
</tr>
<tr>
<td align="right"> logo图标: </td>
<td><input name="t3" type="text" id="t33" value="<%=rs("sogo_link_login")%>" size="60"></td>
</tr>
<tr>
<td align="right" valign="top">站点说明:</td>
<td><textarea name="t4" cols="60" rows="5" id="t4"><%=rs("sogo_link_alt")%></textarea></td>
</tr>
<tr>
<td colspan="2"> <div align="right"><a href="?action=delete&id=<%=id%>" onClick="return confirm_button()"><font color="#FF0000">【删除此链接】</font></a> <%if rs("sogo_link_yes_no")=0 then%><a href="?action=ok&id=<%=id%>"><font color="#FF0000">【审核通过】</font></a><%else%><a href="?action=no&id=<%=id%>"><font color="#FF0000">【待审核】</font></a><%end if%>
<input type="submit" name="Submit" value=" 修 改 ">
</div></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<%
end if
'修改
elseif request("action")="editok" then
id=htmls(encodestr(request("id")))
StrSql = "select * from sogo_link where id="&id
Set rs = server.CreateObject("ADODB.RecordSet")
rs.Open StrSql,Conn,1,2
rs("sogo_link_font")=htmls(encodestr(request("t1")))
rs("sogo_link_url")=htmls(encodestr(request("t2")))
rs("sogo_link_login")=htmls(encodestr(request("t3")))
rs("sogo_link_alt")=htmls(encodestr(request("t4")))
rs("sogo_link_logo_or_txt")=htmls(encodestr(request("logoortxt")))
rs.update
rs.close
response.Redirect("admin.asp")
'通过审核
elseif request("action")="ok" then
id=htmls(encodestr(request("id")))
StrSql = "select * from sogo_link where id="&id
Set rs = server.CreateObject("ADODB.RecordSet")
rs.Open StrSql,Conn,1,2
rs("sogo_link_yes_no")=1
rs.update
rs.close
response.Redirect("admin.asp")
'待审核
elseif request("action")="no" then
id=htmls(encodestr(request("id")))
StrSql = "select * from sogo_link where id="&id
Set rs = server.CreateObject("ADODB.RecordSet")
rs.Open StrSql,Conn,1,2
rs("sogo_link_yes_no")=0
rs.update
rs.close
response.Redirect("admin.asp")
'添加
elseif request("action")="add" then
if request("t1")="" or len(request("t1"))>36 or len(request("t1"))<3 or request("t2")="" or request("t3")="" or left(request("t2"),7)<>"http://" or len(request("t2"))<12 or len(request("t2"))>100 or left(request("t3"),7)<>"http://" or len(request("t3"))>160 or len(request("t3"))<16 or request("t4")="" or len(request("t4"))>255 or len(request("t4"))<2 then
response.write"<script>alert('很抱歉,请正确、完整的填写链接信息!~`');</script>"
response.write "<script>history.go(-1);</script>"
response.End()
end if
StrSql = "select * from sogo_link"
Set rs = server.CreateObject("ADODB.RecordSet")
rs.Open StrSql,Conn,1,2
rs.addnew
rs("sogo_link_font")=htmls(encodestr(request("t1")))
rs("sogo_link_url")=htmls(encodestr(request("t2")))
rs("sogo_link_login")=htmls(encodestr(request("t3")))
rs("sogo_link_alt")=htmls(encodestr(request("t4")))
rs("sogo_link_logo_or_txt")=htmls(encodestr(request("logoortxt")))
rs("sogo_link_yes_no")=1
rs.update
rs.close
response.Redirect("admin.asp")
'删除
elseif request("action")="delete" then
id=htmls(encodestr(request("id")))
conn.execute("delete * from sogo_link where ID=" & id)
response.Redirect("admin.asp")
end if
end if
%></td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -