📄 ad_search.asp
字号:
<!-- #Include File=../ad_check.asp -->
<!-- #Include File=top.asp -->
<!-- #Include File=../sys/inc/prompt.inc -->
<%
call conned()
response.buffer=true
Response.Expires=0
dim keyword
keyword=trim(replace(request("keyword"),"'",""))
if keyword ="" then
errmsg=errmsg+"<br>"+"<li>关键字不能为空!"
call error()
response.end
end if
dim sql
dim rs '实例
dim totalPut '总记录数
dim CurrentPage '当前页
dim TotalPages '总页数
dim i,j
Set rs= Server.CreateObject ("ADODB.RecordSet")
sql = "select * from userinfo where busername like '%"&keyword&"%' order by btime desc"
rs.open sql,conn,1,3
'----------------------------------
if rs.bof and rs.eof then
errmsg=errmsg+"<br>"+"<li>没有您要查找的用户!"
founderr=true
call error()
response.end
end if
'----------------------------------
call top()
rs.MoveFirst '到第一条记录
rs.pagesize=MaxPerPage '定义每页记录数
howmanyfields=rs.Fields.Count-1
If trim(Request("Page"))<>"" then
CurrentPage= CLng(request("Page"))
If CurrentPage> rs.PageCount then
CurrentPage = rs.PageCount
End If
Else
CurrentPage= 1
End If
if rs.eof then
response.write "<p align=center> ERROR!</p>"
response.redirect ("write.asp")
else
totalPut=rs.recordcount 'totalput=总记录数
if CurrentPage<>1 then
if (currentPage-1)*MaxPerPage < totalPut then
rs.move(currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
end if
end if
end if
totalpages=rs.pagecount
set userSet = Server.CreateObject("ADODB.RecordSet")
userSet.open "userinfo",conn,1 ,3
user=userSet.recordcount
userSet.close
set userSet=nothing
%>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="95%" align="center">
<TBODY>
<TR>
<TD width="30%"> <b> <img src="../sys/image/admin.gif" width="17" height="16"> 会员搜索</b></TD>
<TD width="79%">
<P align=right> <img src="../sys/image/ico.gif" width="25" height="16">总页数:<%=TotalPages%> <img
src="../sys/image/rent.gif" width="18" height="13">当前页数:<%=CurrentPage%>
<img border=0
src="../sys/image/people.gif" width="9" height="12"> 注册人数:<%=user%></A> </P>
</TD></TR></TBODY></TABLE>
<table border=1 cellpadding=0 cellspacing=0 width=95% align="center" bordercolor="#0099cc">
<tr>
<td align=middle class=td width=40><font color="#FF0000">删除</font></td>
<td align=middle class=td width=40>
<div align="center"><font color="#FF0000">头像</font></div>
</td>
<td align=middle class=td width=40><font color="#FF0000">性别</font></td>
<td align=middle class=td width=75><font color="#FF0000">用户名称</font></td>
<td align=middle class=td width=75><font color="#FF0000">真实姓名</font></td>
<td align=middle class=td width=50><font color="#FF0000">地区</font></td>
<td align=middle class=td width=*><font color="#FF0000">Oicq</font></td>
<td align=middle class=td width=*><font color="#FF0000">信箱</font></td>
<td align=middle class=td width=40>
<div align="center"><font color="#FF0000">主页</font></div>
</td>
<td align=middle class=td width=40>
<div align="center"><font color="#FF0000">身份</font></div>
</td>
<td align=middle class=td width=110>
<div align="center"><font color="#FF0000">加入日期</font></div>
</td>
</tr>
<%
do while not rs.eof and i < maxperpage
Response.Write "<TR>"
response.write "<td align=center class=td1><a href=ad_operateuser.asp?id=" &rs("id")& "><img src=../sys/image/delete.gif border=0 ></a></td>"
response.write "<td align=center class=td2><img src=" &rs("bface")& " border=0 width=20 height=20></td>"
response.write "<td align=center class=td1>"
if rs("bsex")=0 then
response.write "女"
else
response.write "男"
end if
response.write "</td>"
response.write "<td align=center class=td2>"&rs("busername")&"</td>"
response.write "<td align=center class=td1>"&rs("brlword")&"</td>"
response.write "<td align=center class=td2>"&rs("baddress")&"</td>"
response.write "<td align=center class=td1>"&rs("boicq")&"</td>"
response.write "<td align=center class=td2>"&rs("bmail")&"</td>"
response.write "<td align=center class=td1>"
if len(rs("burl")) < 15 then
response.write "没有"
else
response.write "<a href="&(rs("burl"))&"><img src=../sys/image/home.gif border=0 ></a>"
end if
response.write "</td>"
response.write "<td align=center class=td2>"
if rs("bclass")=1 then
response.write "版主"
else
response.write "用户"
end if
response.write "</td>"
response.write "<td align=center class=td1>"&rs("btime")&"</td>"
titleID=rs("busername")
Response.Write "</TR>"
i=i+1
rs.movenext
loop
%>
</table>
<center>
<table border="0" cellspacing="0" cellpadding="4" width="95%" align="center" bordercolor="#0099CC">
<tr>
<td width="220" height="79" > <span class=smallFont> </span>
<form method=post action=ad_search.asp?keyword=<%=request("keyword")%>>
<span class=smallFont>页次:<%=CurrentPage%>/<%=TotalPages%> 页 转到:
<input
maxlength=5 size=3 value=<% =currentpage %> name=Page>
<input language=javascript id=button1 onClick=viewPage1(document.ad_search.Page.value) type=submit value=Go name=button1>
</span>
</form>
</td>
<td width="*" height="79" >
<div align="right">
<select size="1" name="D1" onChange="MM_goToURL('parent',this.value);return document.MM_returnValue">
<option>跳转页数</option>
<%
soonhost=0
DO WHILE NOT soonhost = rs.PageCount %>
<option value="ad_search.asp?keyword=<%=request("keyword")%>&Page=<% =soonhost+1 %>"><% =soonhost+1 %></option>
<% soonhost=soonhost+1
loop
%>
</select>
<%
'------------------------------------------------------页面跳转
dim n,k
if (totalPut mod MaxPerPage)=0 then 'n表示总页数
n= totalPut \ MaxPerPage
else
n= totalPut \ MaxPerPage + 1
end if
k=currentPage
if k<>1 then
response.write "[<b>"+"<a href=ad_search.asp?keyword="&request("keyword")&"page=1>首页</a></b>] "
response.write "[<b>"+"<a href=ad_search.asp?keyword=" &request("keyword")& "page="+cstr(k-1)+">上一页</a></b>] "
else
Response.Write "[首页] [上一页]"
end if
if k<>n then
response.write "[<b>"+"<a href=ad_search.asp?keyword="&request("keyword")&"page="+cstr(k+1)+"'>下一页</a></b>] "
response.write "[<b>"+"<a href=ad_search.asp?keyword="&request("keyword")&"page="+cstr(n)+">尾页</a></b>] "
else
Response.Write "[下一页] [尾页]"
end if
'------------------------------------------------------页面跳转
rs.close
set rs=nothing
conn.close
set conn=nothing
'====================================================
'程序制做:迅捷网络. http://www.soonhost.com
'迅捷主机网 -- 域名注册、主机租用、网站建设、脚本开发
'网址:http://www.soonhost.com
'msn:soonhost@hotmail.com
'请保留以上版权信息,谢谢合作!
'====================================================
%></div>
</td>
</tr>
</table>
<br>
<%
call search()
sub search ()
%>
<div align=center>
<table width=760 border=0 cellspacing=0 cellpadding=2 align=center>
<tr bordercolor=#0099CC align=center>
<td >
<form name=search action=ad_search.asp method=post>
<div align=left>
<table cellspacing=0 cellpadding=2 width=500
border=1 bordercolor=#0099CC align=center>
<tbody>
<tr>
<td class=td1 width=40%>
<div align=center><font color=#000000>请输入您要搜索的用户名称</font>
</div>
</td>
<td width=41%>
<div align=center>
<input type=text name=keyword maxlength=50>
</div>
</td>
<td width=19%>
<div align=center>
<input type=image height=18
width=39 src=../sys/image/search.gif border=0
name=imageField3 alt=搜索>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</form>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<%
end sub
%>
<!--#include file="../ad_foot.inc"-->
</div>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -