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

📄 search.asp

📁 上传自义地图
💻 ASP
📖 第 1 页 / 共 2 页
字号:
      End If
    End If
  End If

  ' reset the cursor to the beginning
  If (MM_rs.CursorType > 0) Then
    MM_rs.MoveFirst
  Else
    MM_rs.Requery
  End If

  ' move the cursor to the selected record
  MM_index = 0
  While (Not MM_rs.EOF And MM_index < MM_offset)
    MM_rs.MoveNext
    MM_index = MM_index + 1
  Wend
End If
%>
<%
' *** Move To Record: update recordset stats

' set the first and last displayed record
rs_first = MM_offset + 1
rs_last  = MM_offset + MM_size

If (MM_rsCount <> -1) Then
  If (rs_first > MM_rsCount) Then
    rs_first = MM_rsCount
  End If
  If (rs_last > MM_rsCount) Then
    rs_last = MM_rsCount
  End If
End If

' set the boolean used by hide region to check if we are on the last record
MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount)
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters

Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth

Dim MM_removeList
Dim MM_item
Dim MM_nextItem

' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
  MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If

MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""

' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
  MM_nextItem = "&" & MM_item & "="
  If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
    MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
  End If
Next

' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
  MM_nextItem = "&" & MM_item & "="
  If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
    MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
  End If
Next

' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then 
  MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "")  Then
  MM_keepURL  = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
If (MM_keepForm <> "") Then
  MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
End If

' a utility function used for adding additional parameters to these strings
Function MM_joinChar(firstItem)
  If (firstItem <> "") Then
    MM_joinChar = "&"
  Else
    MM_joinChar = ""
  End If
End Function
%>
<%
' *** Move To Record: set the strings for the first, last, next, and previous links

Dim MM_keepMove
Dim MM_moveParam
Dim MM_moveFirst
Dim MM_moveLast
Dim MM_moveNext
Dim MM_movePrev

Dim MM_urlStr
Dim MM_paramList
Dim MM_paramIndex
Dim MM_nextParam

MM_keepMove = MM_keepBoth
MM_moveParam = "index"

' if the page has a repeated region, remove 'offset' from the maintained parameters
If (MM_size > 1) Then
  MM_moveParam = "offset"
  If (MM_keepMove <> "") Then
    MM_paramList = Split(MM_keepMove, "&")
    MM_keepMove = ""
    For MM_paramIndex = 0 To UBound(MM_paramList)
      MM_nextParam = Left(MM_paramList(MM_paramIndex), InStr(MM_paramList(MM_paramIndex),"=") - 1)
      If (StrComp(MM_nextParam,MM_moveParam,1) <> 0) Then
        MM_keepMove = MM_keepMove & "&" & MM_paramList(MM_paramIndex)
      End If
    Next
    If (MM_keepMove <> "") Then
      MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1)
    End If
  End If
End If

' set the strings for the move to links
If (MM_keepMove <> "") Then 
  MM_keepMove = Server.HTMLEncode(MM_keepMove) & "&"
End If

MM_urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "="

MM_moveFirst = MM_urlStr & "0"
MM_moveLast  = MM_urlStr & "-1"
MM_moveNext  = MM_urlStr & CStr(MM_offset + MM_size)
If (MM_offset - MM_size < 0) Then
  MM_movePrev = MM_urlStr & "0"
Else
  MM_movePrev = MM_urlStr & CStr(MM_offset - MM_size)
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Gxjss留言本(Asp程序) 搜索结果</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }
//-->
</script>
</head>

<body leftmargin="1" topmargin="2">
<!--#include file="top.html" -->
<table width="778" border="0" align="center" cellpadding="4" cellspacing="0" class="top">
  <tr>
    <td height="4" colspan="2" bgcolor="#EDFAFD"></td>
  </tr>
  <tr>
    <td width="376" height="36" bgcolor="#F5FCFE"><p><a href="new.asp"><img src="images/gb_new.gif" alt="发表新留言" width="160" height="30" /></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="index.asp"><img src="images/gb_look.gif" alt="查看留言" width="160" height="30" /></a></p></td>
    <td width="386" bgcolor="#F5FCFE"><table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td><form action="search.asp" method="post" name="form1" id="form1">
            <b>查找留言</b>:
          <input name="key" type="text" id="key" size="20" maxlength="12" />
            <input name="button" type="submit" id="button" onclick="MM_validateForm('key','','R');return document.MM_returnValue" value="搜索" />
        </form></td>
      </tr>
    </table></td>
  </tr>
</table>
<table width="778" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" class="bk">
  <% If Not rs.EOF Or Not rs.BOF Then %>
    <tr>
      <td width="370" height="36" align="center">共查找到包含“<font color="#CC0000"><%= Request.Form("key") %></font>”的内容留言[<b><%=(rs_total)%></b>]条,10条/页</td>
      <td width="408">页码&nbsp;&nbsp;
      <%
TM_counter = 0
For i = 1 to rs_total Step MM_size
TM_counter = TM_counter + 1
TM_PageEndCount = i + MM_size - 1
if TM_PageEndCount > rs_total Then TM_PageEndCount = rs_total
if i <> MM_offset + 1 then
Response.Write("<a href=""" & Request.ServerVariables("URL") & "?" & MM_keepMove & "offset=" & i-1 & """>")
Response.Write(TM_counter & "</a>")
else
Response.Write("<b><font color=#CCCCCC>" & TM_counter & "</font></b>")
End if
if(TM_PageEndCount <> rs_total) then Response.Write("︱")
next
 %></td>
    </tr>
    <% End If ' end Not rs.EOF Or NOT rs.BOF %>
<tr>
    <td colspan="3"><% 
While ((Repeat1__numRows <> 0) AND (NOT rs.EOF)) 
%>
        <% If Not rs.EOF Or Not rs.BOF Then %>
          <table width="99%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#D5EAF5" style="table-layout:fixed;border-collapse:collapse;word-break:break-all">
            <tr>
              <td width="15%" align="center" valign="top"><p><img src="<%=(rs.Fields.Item("g_img").Value)%>" alt="我是:<%=(rs.Fields.Item("g_name").Value)%>" /></p>
                <p><b><font color="#CC0000"><%=(rs.Fields.Item("g_name").Value)%></font></b><font color="#CCCCCC"><br />
                  <%
strIP=(rs.Fields.Item("g_ip").Value)
arrIP=split(strIP,".") 
strNewIP=arrIP(0)&"."&arrIP(1)&"."&"256."&arrIP(3)
%><%=strNewIP%></font></p>              </td>
              <td width="85%" valign="top"><table width="100%" border="0" cellpadding="5" cellspacing="0" style="table-layout:fixed;border-collapse:collapse;word-break:break-all">
                  <tr>
                    <td width="60%" bgcolor="#DEEFF7"><b><font color="#0000FF">
                      <% If DateDiff("Y",rs.Fields.Item("g_date").Value,Now) <= 3 Then Response.write("<img src='images/new.gif'>") %>
                      <font color="#0066CC"><%=(rs.Fields.Item("g_title").Value)%></font>
                    </font></b></td>
                    <td width="40%" bgcolor="#DEEFF7"><a href="mailto:<%=(rs.Fields.Item("g_mail").Value)%>" title="<%=(rs.Fields.Item("g_mail").Value)%>">发邮件</a>&nbsp; 发表于 <%=(rs.Fields.Item("g_date").Value)%></td>
                  </tr>
                  <tr>
                    <td colspan="2"><%=HTMLEncode(rs.Fields.Item("g_content").Value)%></td>
                  </tr>
                  
                  <tr>
                    <td colspan="2"><table width="100%" border="0" cellpadding="4" cellspacing="0" class="bkse">   
                        <tr>
                        <td><font color="#666666"><b>站长回复:</b><%=(rs.Fields.Item("g_reply").Value)%></font></td>
                      </tr>
                    </table>                      </td>
                  </tr>
                  
                  
              </table></td>
            </tr>
          </table>
      <br />
          <% End If ' end Not rs.EOF Or NOT rs.BOF %>
        <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  rs.MoveNext()
Wend
%>
      <% If rs.EOF And rs.BOF Then %>
        <table width="100%" border="0" align="center" cellspacing="0" class="bkse">
          <tr>
            <td height="400" colspan="3" align="center"><p><b>没有查找到您输入的内容“<font color="#CC0000"><%= Request.Form("key") %></font>”,请重新输入</b>!</p></td>
          </tr>
        </table>
        <% End If ' end rs.EOF And rs.BOF %></td>
  </tr>
</table>
<!--#include file="bottom.html" -->
</body>
</html>
<%
rs.Close()
Set rs = Nothing
%>

⌨️ 快捷键说明

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