⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 search.asp

📁 发布整站源码 可以再开发~ 本人实用中 效果嗷嗷滴~
💻 ASP
字号:
<!--#include file="config.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="code.asp"-->
<%
if not isempty(request("page")) then
		currentPage=cint(request("page"))
	else
		currentPage=1
	end if
menu=htmlencode(request("menu"))
key=htmlencode(request("key"))
otype=htmlencode(request("otype"))

if key="" then
response.write "<script>alert('请输入查询条件');history.back()</script>"
response.end
elseif menu="" or (not isnumeric(menu)) or isnull(menu) then
menu="all"
elseif int(menu)>uBound(split(lsign,",")) then
menu="all"
end if

set rs = server.createobject("adodb.recordset")
%>
<HTML><HEAD><TITLE><%=webname%>::查找结果</TITLE>
<META http-equiv=Content-Language content=zh-cn>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content=私服宣传,私服技术,休闲娱乐 name=keywords>
<LINK href="image/css.css" type=text/css rel=stylesheet>
<META content="Microsoft FrontPage 6.0" name=GENERATOR></HEAD>
<BODY leftMargin=0 background="<%=bgimage%>" topMargin=0>
<!--#include file="top.asp"-->
<!--#include file="ad.asp"-->
<table width="50%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="10"></td>
  </tr>
</table>    
<table width="1004" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#990000">
<td width="87"><div align="left"><b><font color="#FFFFFF">千年服务器名</font></b></div></td>
<td width="112"><div align="left"><b><font color="#FFFFFF">服务器IP</font></b></div></td>
<td width="178"><div align="left"><b><font color="#FFFFFF">开放时间 年/月/日/时</font></b></div></td>
<td width="77" align="center"><div align="left"><b><font color="#FFFFFF">线路类别</font></b></div></td>
<td width="37"><div align="left"><b><font color="#FFFFFF">类型</font></b></div></td>
<td width="153"><div align="left"><b><font color="#FFFFFF">版本介绍</font></b></div></td>
<td width="137"><div align="left"><b><font color="#FFFFFF">客服QQ</font></b></div></td>
<td width="55" align="center"><div align="left"><b><font color="#FFFFFF">详细介绍</font></b></div></td>
<td width="68"><div align="left"><b><font color="#FFFFFF">推荐星级</font></b></div></td>
</tr>
</table>
<table width="1004" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#FF9900">
  <%
if menu<>"all" then
sql="select SFdata.id,SFdata.name,SFdata.IP,SFdata.daikuan,SFdata.service,SFdata.renshu,SFdata.Sdate,SFdata.addr,SFdata.xingzhi,SFdata.email,SFdata.homepage,SFdata.download,SFdata.gameid,Gametype.game "
sql=sql&" from SFdata,Gametype where "&otype&" like '%"&key&"%' and SFdata.gameid=gametype.id and SFdata.gameid="&menu
sql=sql&" and SFdata.ulock=1 order by SFdata.addtime desc"
else
sql="select SFdata.id,SFdata.name,SFdata.IP,SFdata.daikuan,SFdata.service,SFdata.renshu,SFdata.Sdate,SFdata.addr,SFdata.xingzhi,SFdata.email,SFdata.homepage,SFdata.download,SFdata.gameid,Gametype.game "
sql=sql&" from SFdata,Gametype where "&otype&" like '%"&key&"%' and SFdata.gameid=gametype.id"
sql=sql&" and SFdata.ulock=1 order by SFdata.addtime desc"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<tr bgColor=#FFFFFF><td colspan=8 align=center>查找结果:<font color=red>没有找到您想要的私服~!</font></td></tr>"
rs.close
else
	totalPut=rs.recordcount 
	if currentpage<1 then 
		currentpage=1 
	end if 
	if (currentpage-1)*MaxPerPage>totalput then 
		if (totalPut mod MaxPerPage)=0 then 
	  		currentpage= totalPut \ MaxPerPage 
		else 
			currentpage= totalPut \ MaxPerPage + 1 
		end if 
	end if 
 	if currentPage=1 then 
		showContent 
		showpage totalput,MaxPerPage,"search.asp" 
 	else 
 		if (currentPage-1)*MaxPerPage<totalPut then 
			rs.move  (currentPage-1)*MaxPerPage 
			showContent 
 			showpage totalput,MaxPerPage,"search.asp" 
  		else 
	  		currentPage=1 
  			showContent 
  			showpage totalput,MaxPerPage,"search.asp" 
			end if 
		end if 
		rs.close 
	end if
	sub showContent 
 	dim i 
	i=0 
%>
  <%do while not rs.eof%>
<tr bordercolor="#FFFFFF" bgcolor="#FFFFcc" class="style52" onmouseover=javascript:this.bgColor='#FFee88' onmouseout=javascript:this.bgColor='#ffffcc'>
    <td class="style6" width="87">&nbsp;<a href=display.asp?id=<%=rs("id")%> target=show><%=rs("name")%></a></td>
    <td class="style6" width="112">&nbsp;<%=rs("IP")%></td>
    <td class="style49" width="178">&nbsp;
    <%if rs("Sdate")<>"" then response.write year(rs("sdate"))&"年/"&month(rs("sdate"))&"月/"&day(rs("Sdate"))&"日/"&hour(rs("sdate"))&"点开放"%></td>
    <td class="style49" width="77" align='center'><%=rs("Addr")%><%=split(ssign,",")(rs("Service"))%></td>
    <td class="style49" width="37" align='center'><%if menu="all" then response.write rs("game") else response.write split(rsign,",")(rs("renshu")) end if%></td>
    <td class="style6" width="153"><%=rs("xingzhi")%></td>
    <td class="style6" width="137">客服QQ:<%=rs("email")%></td>
    <td class="style5" width="56" align='center'><a href=display.asp?id=<%=rs("id")%> target=show>查看</a></td>
    <td class="style6" width="67" align='center'><font color="#FF0000">★★★★</font></td>
  </tr>

  <%
i=i+1
if i>=MaxPerPage then exit do
	rs.movenext 
loop
%>
</table>
<table width="50%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="10"></td>
  </tr>
</table>
<div align="center">
<table width="1004" border="1" cellpadding="5" cellspacing="1" bordercolor="#FF9900" height="30">
<tr>
<td width="904" bgcolor="#FFFFFF" height="30"><%
		  call search()
		  end sub
		  %>
 </td>
</tr>
</table>
</div>
<!--#include file="foot.asp"-->
<%
function showpage(totalnumber,maxperpage,filename)
  	dim n
  	if totalnumber mod maxperpage=0 then
  		n= totalnumber \ maxperpage
  	else
  		n= totalnumber \ maxperpage+1
  	end if
  	response.write "<table align=right><tr><form method=Post action="&filename&"?menu="&menu&"><td>"

  	if CurrentPage<2 then
 		response.write "共"&totalnumber&"条记录&nbsp;首页 上页&nbsp;"
  	else
 		response.write "共"&totalnumber&"条记录&nbsp;<a href="&filename&"?page=1&menu="&menu&">首页</a>&nbsp;"
 		response.write "<a href="&filename&"?page="&CurrentPage-1&"&menu="&menu&">上页</a>&nbsp;"
  	end if

  	if n-currentpage<1 then
 		response.write "下页 尾页"
  	else
 		response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&menu="&menu&">"
 		response.write "下页</a> <a href="&filename&"?page="&n&"&menu="&menu&">尾页</a>"
  	end if
	response.write "&nbsp;页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
 	response.write "&nbsp;<b>"&maxperpage&"</b>条记录/页 "
	response.write "转:<select name="&page&" size=1 onchange=javascript:submit()>"
	for i = 1 to n
		response.write "<option value="&i&" "
			if cint(Page)=cint(i) then
				response.wirte "selected "
			end if
		response.write ">第"&i&"页</option>"
	next
	response.write "</select></td></form></tr></table>"
end function

sub search()
response.write "<table width=768 align=center><form method=get action=search.asp><tr height=30><td bcolspan=7>&nbsp;搜索关键字<input name=key type=text ><SELECT class=input name=otype><OPTION class=input value=name selected>信息标题</OPTION><OPTION class=input value=main>信息内容</OPTION><OPTION class=input value=ip>私服IP</OPTION><OPTION class=input value=addr>所在地区</OPTION></SELECT>"
if menu="all" then
response.write "查找范围:所有范围<input name=menu type=radio value=all checked>"
else
response.write "查找范围:本类信息<input name=menu type=radio value="&menu&" checked> 所有范围<input name=menu type=radio value=all>"
end if 
response.write "<input type=submit value= 开始查找></td></tr></form></table>"
end sub
set rs=nothing
%>    
</BODY>
</HTML>
<%
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -