?? search.asp
字號:
<!--#include file="conn.asp"-->
<%
Set rs = Server.CreateObject("ADODB.Recordset")
name=trim(request("keyword"))
if name="" then
response.write "<SCRIPT language=JavaScript>alert('查找字符不能為空!');"
response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
response.end
end if
sql="select * from music WHERE name Like '%"& name &"%' or address Like '%"& name &"%' order by id desc"
rs.open sql,conn,1,1
if rs.eof then
response.write "<SCRIPT language=JavaScript>alert('對不起,沒有找到您要找的網站!');"
response.write "this.location.href='vbscript:history.back()';</SCRIPT>"
response.end
else
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>手機網站搜索結果</title>
<SCRIPT language=JavaScript>
<!--
function expandingWindow(website) {
var heightspeed = 2; // vertical scrolling speed (higher = slower)
var widthspeed = 7; // horizontal scrolling speed (higher = slower)
var leftdist = 0; // distance to left edge of window
var topdist = 0; // distance to top edge of window
var winwidth = window.screen.availWidth - leftdist;
var winheight = window.screen.availHeight - topdist;
var sizer = window.open("","","left=" + leftdist + ",top=" + topdist + ",width=1,height=1,scrollbars=yes");
for (sizeheight = 1; sizeheight < winheight; sizeheight += heightspeed) {
sizer.resizeTo("1", sizeheight);
}
for (sizewidth = 1; sizewidth < winwidth; sizewidth += widthspeed) {
sizer.resizeTo(sizewidth, sizeheight);
}
sizer.location = website;
}
-->
</SCRIPT>
<style type="text/css">
<!--
td { font-size: 12px; line-height: 17px }
body { font-size: 12px; line-height: 17px }
p { margin-top: 1px; margin-bottom: 1px }
a:link { text-decoration: none; color: black }
a:visited { text-decoration: none; color: black }
a:active { text-decoration: none }
a:hover { text-decoration: underline; color: red }
-->
</style>
</head>
<body>
<!--#include file="head2.asp"-->
<br>
<div align="center">
<center>
<table border="0" width="320" cellspacing="0" cellpadding="0">
<TR>
<TD align=middle width=252><P align=right><INPUT name=keyword class=login id="keyword" size="25" maxLength=25>
</P></TD>
<TD width=128> <input name="Submit2" type="submit" id="Submit2" value="網站搜索"> </TD>
</TR>
</table>
<table border="0" width="320" cellspacing="0" cellpadding="0">
<tr>
<td width="320" valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<%
'else
const maxperpage=20
dim currentpage
rs.pagesize=maxperpage
currentpage=request.querystring("pageid")
if currentpage="" then
currentpage=1
elseif currentpage<1 then
currentpage=1
else
currentpage=clng(currentpage)
if currentpage > rs.pagecount then
currentpage=rs.pagecount
end if
end if
if not isnumeric(currentpage) then
currentpage=1
end if
dim totalput,n
totalput=rs.recordcount
if totalput mod maxperpage=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
if n=0 then
n=1
end if
rs.move(currentpage-1)*maxperpage
i=0
w=1
do while i< maxperpage and not rs.eof
red_name = replace(rs("name"),name,"<font color=#ff0000>"&name&"</font>")
%>
<td><%=w%>、[<a href="<%=rs("address")%>" target="_blank"><%=rs("name")%></a>]
<%
i=i+1
w=w+1
rs.movenext
if i mod 3=0 then
response.write "</tr><tr>"
end if
loop
end if
%>
</td>
</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td height="1">
................................................. </td>
<tr>
<td height="30"><p align="center">
<%k=currentpage
if k<>1 then%>
<a href="search.asp?pageid=1">首頁</a>
<a href="search.asp?pageid=<%=k-1%>">上一頁</a>
<%else%>
首頁 上一頁
<%end if%>
<%if k<>n then%>
<a href="search.asp?pageid=<%=k+1%>">下一頁</a>
<a href="search.asp?pageid=<%=n%>">尾頁</a>
<%else%>
下一頁 尾頁
<%end if%>
共找到<font color="red"><%=totalput%></font>個相關網站</p> </td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>
<!--#include file="foot.asp"-->
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -