| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 407 人关注过本帖
标题:做了1个留言板的主题搜索,遇到了1个问题
只看楼主 加入收藏
zkjd52
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2012-10-27
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
做了1个留言板的主题搜索,遇到了1个问题
制作了1个留言板的主题搜索,当搜不到东西就出错(出错整个页面打不开提示:An error occurred on the server when processing the URL. Please contact the system administrator.
If you are the system administrator please click here to find out more about this error.
)!搜得到东西就能正确显示出来,不知道错在哪?我把整页代码帖出来:
程序代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.>
<html xmlns="http://www.>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/conngongsi.asp" -->
<%response.Charset="utf-8"%>
<%  keyword=request.QueryString("keyword")                                      '获取keyword参数和建立记录集
    If (CStr(Request("MM_insert")) = "form1") Then
         if keyword=""then
         response.write " <script language='javascript'>"
         response.write "alert( '请输入内容后在查询! ');"
         response.write "history.go(-1);"
         response.write "</script> "
         response.end
         end if
    end if         
   sql="select * from book where book_biaoti like '%"&keyword&"%' ORDER BY ID DESC"
   set rs1=server.CreateObject("adodb.recordset")
   rs1.open sql,MM_conngongsi_STRING,1,3
%>
<%                                                        
rs1.pagesize=5                                           '分页代码
if request.QueryString("page")<>"" then
     epage=cint(request.QueryString("page"))
     if epage<1 then epage=1
     if epage>rs1.pagecount then epage=rs1.pagecount
     else
     epage=1

 end if
rs1.absolutepage=epage
%>
<% If (CStr(Request("yeshu")) = "form2") Then
       if request.QueryString("dpage")="" then                   '从表单dpage项获取要访问的页面
         response.write " <script language='javascript'>"
         response.write "alert( '请输入要到达的页数! ');"
         response.write "history.go(-1);"
         response.write "</script> "
         response.end
       else    
       dwg=request.QueryString("dpage")
       response.redirect "lyb.asp?keyword="&keyword&"&page="&dwg&""
       end if
  end if
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>留言簿</title>
<style type="text/css">
@import url("book_biaoti.css");

body,td,th {
    font-size: 12px;
}
body {
    margin-top: 0px;
    background:url(tupian/bg.gif)
}
.size12 {
    font-size: 12px;
}
</style>
<link href="book_biaoti.css" rel="stylesheet" type="text/css" />
</head>

<body >
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="192" colspan="7"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.,0,28,0" width="801" height="270">
      <param name="movie" value="tupian/index.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <embed src="tupian/index.swf" quality="high" wmode="opaque" pluginspage="http://www. type="application/x-shockwave-flash" width="801" height="270"></embed>
    </object></td>
  </tr>
  <tr align="center">
    <td height="43" colspan="7" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#00ccFF">
      <tr>
        <td width="12%" height="43" align="center"><a href="index.asp" target="_top"><strong>首页</strong></a></td>
        <td width="12%" align="center"><strong>关于尚维</strong></td>
        <td width="12%" align="center"><strong>服务项目</strong></td>
        <td width="12%" align="center"><strong>收费标准</strong></td>
        <td width="12%" align="center"><strong>网站建设</strong></td>
        <td width="12%" align="center"><a href="fjsc.asp" target="_top"><strong>分享你的资源</strong></a></td>
        <td width="12%" align="center"><a href="lyb.asp" target="_top"><strong>留言簿</strong></a></td>
        <td width="12%" align="center"><a href="lianxi.asp" target="_top"><strong>联系我们</strong></a></td>
      </tr>
    </table></td>
  </tr>
  <tr><td colspan="5">

 
  </td>
   
  </tr>
  <tr>
  
    <td width="137" height="23"><strong>你的位置</strong>-- <a href="fbly.asp" target="_top">留言</a> 簿   </td>
    <form id="form1" name="form1" method="get" action=""><td width="51"  align="right">主题查询:</td>     
    <td width="205">
      <label for="keyword"></label>
      <input name="keyword" type="text" id="keyword" maxlength="20" style="width:200px;"/></td>
    <td width="161"><input type="submit" name="submit" id="submit" value="查询" />
      <input name="MM_insert" type="hidden" id="MM_insert" value="form1" /></td>
    </form>
    <td width="248" >现在的时间是<%=now()%><a href="admin_login.asp" target="_top">管理员登陆</a></td>
  </tr>
  <tr>
    <td colspan="6" valign="top"> 

<%
  for i=0 to rs1.pagesize-1
  if rs1.eof or rs1.bof then exit for                      '显示记录集的内容
%>
<table width="800" border="0" cellspacing="0" cellpadding="0">        
  <tr>
    <td width="96" height="26" bgcolor="#66FFFF">留言标题:</td>
    <td width="607" bgcolor="#66FFFF"><%response.write rs1("book_biaoti")%>&nbsp;</td>
    <td width="97" bgcolor="#66FFFF">ID:
      <%response.write rs1("ID")%>&nbsp;</td>
    </tr>
  <tr>
    <td height="26">留言内容:</td>
    <td colspan="2"><%response.write rs1("book_neirong")%>&nbsp;</td>
    </tr>
  <tr>
    <td height="27">留言时间:</td>
    <td colspan="2"><%response.write rs1("book_shijian")%>&nbsp;</td>
    </tr>
  <tr>
    <td height="23">留言者IP:</td>
    <td colspan="2"><%response.write rs1("book_ip")%>&nbsp;</td>
    </tr>
  <tr>
    <td height="26" >管理员回复:</td>
    <td height="26" colspan="2" ><%response.write rs1("book_huifuneirong")%></td>
  </tr>
</table>
<%
rs1.movenext()
next
%>

<% If rs1.eof and rs1.bof Then %>
  <p align="center"> 目前没有任何留言</p>
<% End If %>
<table width="501" border="0" >
  <tr><td width="142" height="30"><strong>共有<%=rs1.recordcount%>个留言,第<%=epage%>/<%=rs1.pagecount%></strong></td><td width="130" >

 <strong>

 <% if epage=1 then                                                                '分页代码
  response.write "首页"
  response.write "上一页"
  else 
  response.write "<a href='lyb.asp?keyword="&keyword&"&page=1'>首页</a>"
  response.write "<a href='lyb.asp?keyword="&keyword&"&page="&epage-1&"'>前一页</a>"
  end if

 if epage=rs1.pagecount then

 response.write "下一页"

 response.write "末页"

 else

 response.write "<a href='lyb.asp?keyword="&keyword&"&page="&epage+1&"'>下一页</a>"

 response.write "<a href='lyb.asp?keyword="&keyword&"&page="&rs1.pagecount&"'>末页</a>"

 end if
%>
</strong></td>
<%if keyword=""then%>
<form id="form2" name="form2" method="get"><td width="35"><strong>跳转至</strong></td><td width="40"><input name="dpage" type="text" style="width:40px;" size="4" maxlength="4" onkeyup="value=value.replace(/[^\d]/g,'')" /></td><td width="13"><strong></strong></td><td width="115">  <input type="submit" value="确定"/>
  <input name="yeshu" type="hidden" id="yeshu" value="form2" /></td></form>
<%end if%>
</tr>

</table>
</td>
  </tr>
  <tr>
    <td height="35" colspan="7" bgcolor="#00ccFF" align="center">Copyringht&nbsp;&copy;&nbsp;2012-2112&nbsp;尚维公司版权所有.All Rights Reserved</td>
  </tr>
</table>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>


搜索更多相关主题的帖子: occurred contact 留言板 please system 
2012-10-27 18:20
gnikil
Rank: 2
等 级:论坛游民
帖 子:7
专家分:20
注 册:2010-8-6
收藏
得分:20 
加上记录集判断语句
if rs1.eof or rs1.bof then
response.write "没有搜索到相关记录!"
response.end()
end if
2012-10-29 13:46
快速回复:做了1个留言板的主题搜索,遇到了1个问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.031034 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved