📄 editview.asp
字号:
<%@ language=vbscript %>
<!--#include file="config.asp"-->
<!--#include file="conn.inc"-->
<%
response.buffer=true
if session("username")="" or session("passw")="" then
response.redirect "ad_log.asp"
end if
%>
<%
if session("username")="admin" and session("passw")="admin" then
'---------------修改密码
%>
<%
sql="select * from mis"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,3
total=rs.recordcount
'-------------------------------------------------------------------
if not isnumeric(request("page")) or isempty(request("page")) then
page=1
else
page=int(abs(request("page")))
end if
rs.pagesize=5
mypagesize=rs.pagesize
rs.absolutepage=page
%>
<html>
<head>
<title><%=titlemark%>通讯录</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="config.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" background="bg01.gif">
<SCRIPT language="javascript">
function show(url)
{
var loginWin = window.open(url,"_blank","top=10,left=10,height=400,width=500,toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=0,status=0");
}
</SCRIPT>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<div align="center"><b><font color="#0066FF"><%=titlemark%>通讯地址 (共有记录<font color=red><%=total%></font>条)
<hr noshade color="green" size=1>
</font></b></div>
</td>
</tr>
</table>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="40" height="8">编号</td>
<td width="160" height="8">姓名</td>
<td width="330" height="8">地址</td>
<td width="100" height="8">电话</td>
<td width="80" height="8">oicq</td>
<td width="40" height="8">性别</td>
</tr>
<tr>
<td colspan="6" height="9">
<hr noshade color="green" size=1>
</td>
</tr>
</table>
<!-- Start -->
<%
dim i
i=1
do while not rs.eof and mypagesize>0 '----------这里的mypagesize>0不能丢,它是跳出循环的判断条件
name=rs("name")
sex=rs("sex")
oicq=rs("oicq")
addr=rs("addr")
phone=rs("phone")
userid=rs("id")
%>
<table width="750" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="40"><font color="red"><%=i+(page-1)*rs.pagesize%></font></td>
<td width="160"><a href='javascript:show("list.asp?id=<%=userid%>")'><%=name%></a></td>
<td width="330"><%=addr%></td>
<td width="100"><%=phone%></td>
<td width="80"><%=oicq%></td>
<td width="40"><%=sex%></td>
</tr>
</table>
<table width="750" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><%
if session("username")="admin" and session("passw")="admin" then
'----------------修改管理员帐号、密码
%>
<div align="right"><a href="dele.asp?id=<%=userid%>">删除</a> </div>
<%end if%>
</td>
</tr>
<tr>
<td>
<hr noshade size="1" color="#cccccc">
</td>
</tr>
</table>
<%
mypagesize=mypagesize-1 '-------------设定为10 这样只能循环10 次 减为0时跳出循环
i=i+1
rs.movenext
loop
'-------------------显示记录到此结束
%>
<a href="index.asp">录入</a> <a href="guestbook/index.asp" target="_blank">留言</a>
<table width="75%" border="0" align="center">
<tr>
<td>
<div align="center">页数:
<%
if page>1 then '-------------------如果是在第一页以后则 显示上一页
%>
<a href=editview.asp?page=<%=page-1%>>上一页</a>
<%
end if
%>
<%
if rs.pagecount<=3 then '---------------如果总共分页数少于或等于3页 则只用123显示
for j=1 to rs.pagecount
response.write "[<a href=editview.asp?page="&j&">"&j&"</a>]"
next
else '----------------如果多于3页 则前三页用123标出
for j=1 to 3
response.write "[<a href='editview.asp?page="&j&"'>"&j&"</a>] "
next
response.write "[<a href='editview.asp?page="&rs.pagecount&"' title='最后一页'>最后一页</a>]"
end if
%>
<%
'-------------最后一页
if page<rs.pagecount then%>
<a href='editview.asp?page=<%=page+1%>'>下一页</a>
<%
end if
%>
</div>
</td>
</tr>
</table>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<%
else
response.write "<html>"
response.write "<head>"
response.write "<title>"
response.write "非法用户"
response.write "</title>"
response.write "</head>"
response.write "<body>"
response.write "<a href=ad_log.asp>"
response.write "非法用户你没有权限!请返回!"
response.write "</a>"
response.write "</body>"
response.write "</html>"
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -