📄 index.asp
字号:
<%@ language=vbscript %>
<!--#include file="config.asp"-->
<!--#include file="conn.inc"-->
<%
response.buffer=true
%>
<%
llname=session("username")
sql="select * from mis"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,3
total=rs.recordcount
if total<1 then
response.redirect "input.asp"
end if
'-------------------------------------------------------------------
if not isnumeric(request("page")) or isempty(request("page")) then '----?????????????
page=1
else
page=int(abs(request("page")))'-------------??????????????????????
end if
rs.pagesize=10
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="468" border="0" align="center" height="60">
<tr>
<td><%
set myad=server.createobject("MSWC.ADROTATOR")
myad.targetframe="target=""adframe"""
%>
<%
=myad.getadvertisement("adrot.txt")
%></td>
</tr>
</table>
<br>
<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>条,欢迎你<font color="red"><%=llname%></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>
<hr noshade size="1" color="#cccccc">
</td>
</tr>
</table>
<%
mypagesize=mypagesize-1 '-------------设定为10 这样只能循环10 次 减为0时跳出循环
i=i+1
rs.movenext
loop
'-------------------显示记录到此结束
%>
<table width="75%" border="0" align="center">
<tr>
<td>
<div align="center">页数:
<%
if page>1 then '-------------------如果是在第一页以后则 显示上一页
%>
<a href=index.asp?page=<%=page-1%>>上一页</a>
<%
end if
%>
<%
if rs.pagecount<=3 then '---------------如果总共分页数少于或等于3页 则只用123显示
for j=1 to rs.pagecount
response.write "[<a href=index.asp?page="&j&">"&j&"</a>]"
next
else '----------------如果多于3页 则前三页用123标出
for j=1 to 3
response.write "[<a href='index.asp?page="&j&"'>"&j&"</a>] "
next
response.write "[<a href='index.asp?page="&rs.pagecount&"' title='最后一页'>最后一页</a>]"
end if
'-------------最后一页
%>
<%
if page<rs.pagecount then%>
<a href='index.asp?page=<%=page+1%>'>下一页</a>
<%
end if
%>
</div>
</td>
</tr>
</table>
<br>
<form name="form2" method="post" action="find.asp">
<table width="75%" border="0" align="center" height="37">
<tr>
<td height="42">
<div align="center">
<select name="topic">
<option value="1">按姓名搜</option>
<option value="2">按性别搜</option>
<option value="3">按电话搜</option>
<option value="4">按地址搜</option>
<option value="5">按oicq搜</option>
<option value="0" selected>智能搜索</option>
</select>
关键词:
<input type="text" name="key">
<input type="submit" name="Submit2" value="给我搜">
</div>
</td>
</tr>
</table>
<br>
<table width="75%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#999999" bordercolorlight="#999999" bordercolordark="#f7f7f7">
<tr>
<td height="9" bgcolor="#CCCCCC">
<div align="center"><%=titlemark%>管理中心</div>
</td>
</tr>
<tr>
<td>
<div align="center"><a href="log.asp">登陆</a>---<a href="input.asp">加入通讯录</a>---<a href="guestbook/index.asp" target="_blank">留言板</a>---<a href="edit.asp">个人资料修改</a>---<a href="per.asp">查看个人资料</a>--<a href="ad_log.asp">超级管理员入口</a></div>
</td>
</tr>
</table>
</form>
<!--#include file="foot.asp"-->
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -