友情链接管理
来源:互联网 发布:医保人头人次比的算法 编辑:程序博客网 时间:2024/06/05 01:25
<!--#include file="file:///E:/fuxer/conn.asp"-->
<%if session("nyeee_admin")="" then
response.redirect "login.asp"
end if%>
<%dim action,id,dname
id=request.QueryString("id")
action=request.querystring("action")
dweb=trim(request("web"))
select case action
case "add"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from nyeee_link",conn,1,3
rs.AddNew
rs("web")=dweb
rs("link")=trim(request("link"))
rs.Update
rs.Close
set rs=nothing
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from nyeee_link where id="&id,conn,1,3
rs("web")=dweb
rs("link")=trim(request("link"))
rs.Update
rs.Close
set rs=nothing
case "del"
conn.execute ("delete from nyeee_link where id="&id)
conn.close
set conn=nothing
response.Redirect "link.asp"
end select
%>
<html>
<head>
<title>友情链接管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="file:///D|/总/我的文档/桌面/style.css" type="text/css">
</head>
<body>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
<tr>
<td height="20" bgcolor="#799AE1" align="center"><font color="#FFFFFF" style="font-size:14px">友 情 链 接 管 理</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"> <br>
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
<tr align="center" bgcolor="#FFFFFF" height="20">
<td width="30">编号</td>
<td>网站名称</td>
<td>网址链接</td>
<td>管理操作</td>
</tr>
<%set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from nyeee_link order by id",conn,1,1
dim follows
if rs.EOF and rs.BOF then
response.write"<tr bgcolor=#FFFFFF><td colspan='4'><p align='center'><font color='red'>暂无友情链接!</font></td></tr></table><br>"
follows=0
else
do while not rs.EOF
i=i+1
%>
<form name="form1" method="post" action="">
<tr bgcolor="#FFFFFF" align="center">
<td><%=i%></td>
<td><input name="web" type="text" id="web" value="<%=trim(rs("web"))%>" size="12"></td>
<td><input name="link" type="text" id="link" value="<%=trim(rs("link"))%>" size="20"></td>
<td><input type="submit" name="Submit" value="修 改">
<input type="button" name="DEL" onClick="{if(confirm('确定要删除这个友情链接吗?/n此操作不可以恢复!')){location.href='?id=<%=rs("id")%>&action=del';}return false;}" value="删除" >
</td>
</tr>
</form>
<%
rs.MoveNext
loop
follows=rs.RecordCount
end if%>
</table>
<br></td>
</tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
<tr>
<td height="20" bgcolor="#799AE1" align="center"><font color="#FFFFFF" style="font-size:14px">添 加 友 情 链 接</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<br>
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
<tr align="center" bgcolor="#FFFFFF" height="20">
<td width="30">编号 </td>
<td>网站名称</td>
<td>网址链接</td>
<td>确定操作</td>
</tr>
<form name="form1" method="post" action="">
<tr align="center" bgcolor="#FFFFFF">
<td><%=rs.RecordCount+1%></td>
<td><input name="web" type="text" id="web" size="12"></td>
<td><input name="link" type="text" id="link" size="20"></td>
<td><input type="submit" name="Submit3" value="添 加"></td>
</tr>
</form>
</table>
<br></td>
</tr>
</table>
</body>
</html>