| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1487 人关注过本帖
标题:这个问题我一星期没睡好了。
取消只看楼主 加入收藏
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
 问题点数:0 回复次数:4 
这个问题我一星期没睡好了。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!--#include file="conn.asp"--> <!--#include file="inc/strchk.asp"--> <!--#include file="inc/mypage.asp"--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script language="javascript"> function sarch() { var x=document.form2.ttc if (x.value=="") { alert("请输入关键字") x.focus() return false } return true } function sea() { window.open('search.asp','sea','height=150,width=460,top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no') } </script> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>查看留言</title> <link rel=stylesheet type="text/css" href="css/my.css"> </head> <body background="image/205.gif" topmargin="0px"> <% search=request("search") ttc=trim(request("ttc")) if request.form("submit")="查找" then set rst=server.createobject("adodb.recordset") select case search case 1 sqlt="select * from mybook where name like '%"&strchk(ttc)&"%' order by time desc" case 2 sqlt="select * from mybook where title like '%"&strchk(ttc)&"%' order by time desc" end select rst.open sqlt,conn,1,1 %><%if rst.eof or rst.bof then%> <div align="center">没找到你要的信息<a href=rword.asp>返回</a></div> <%else%> <table width="671" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="669" height="313"> <table width="410" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#00CCFF"> <tr> <td width="410" align="center">共搜索到<%=rst.recordcount%>篇文章<font color=#FF0066><%=search%></font>符合,关键词:<font color=#FF0066><%=ttc%></font><a href="rword.asp">显示所有留言</a></td> </tr> </table> <table width="670" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#7EBEC0" class=k1> <tr> <td width="228" height="31">返回首页||<a href="rword.asp">查看留言</a>||<a href="login.asp">管理登陆</a>||<a href="index.asp">发表留言</a></td> <td width="18"><img src="image/search.gif" width="15" height="12"> </td> <td width="316"><form action="rword.asp" method="post" name="form2" onsubmit="return sarch()"> <input name="ttc" type="text" class="text"> <input type="radio" name="search" value="1" checked> 姓名 <input type="radio" name="search" value="2"> 标题 <input name="Submit" type="submit" class="text" value="查找"> </form></td> <td width="104"></td> </tr> </table> <% url="rword.asp?search="&search&"ttc="&ttc rst.pagesize=3 PageNo=request("PageNo") if PageNo="" or PageNo=0 then PageNo=1 rst.AbsolutePage=PageNo TSum=rst.pagecount maxperpage=rst.pagesize PageNo=PageNo+1 PageNo=PageNo-1 if CINT(pageno)>1 then if CINT(pageno)>CINT(TSum) then response.Write("对不起没有您想要的页数") Response.End end if end if if PageNo<0 then response.Write("没有这一页!") Response.End End if i=0 do while not rst.eof and i<rst.pagesize%> <table width="670" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#0099FF" class="k1" > <tr bgcolor="#FFFFFF" class=k1> <td height="19" bgcolor="#EDF3FF">作者: <%if rst("name")<>"" then%> <%=rst("name")%> <%else response.write("匿名") end if%> </td> <td width="460" height="19" bgcolor="#EDF3FF"><img src="image/qq.gif" width="16" height="16" alt="<%=rst("qq")%>"> <a href="">mailt<%=rst("email")%>"><img src="image/mail.gif" width="16" height="16" border=0> </a><a href=<%=rst("homepage")%>><img src="image/home.gif" width="16" height="16" border=0></a>来自:<%=rst("ip")%></td> </tr> <tr bgcolor="#FFFFFF"> <td width="202" height="148" valign="top" bgcolor="#EDF3FF"><%if rst("sex")="male" then%> <img src="sex/boy.gif" width="23" height="21"> <%else%> <img src="sex/girl.gif"> <%end if%></br> <br><img src="image/<%=rst("face")%>"><%=rst("time")%></td> <td valign="top" bgcolor="#EDF3FF" > 标题:<%=rst("title")%> <hr align="left" width=100 size=1px noshade> </br> <img src="fpic/<%=rst("fpic")%>"><%=cpic(rst("word"))%> </td> </tr> </table> <%i=i+1 rst.movenext loop %> <table width="537" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td height="23" valign="top"> <div align="right"> <% call showpage(url,rst.RECORDCOUNT,maxperpage,false,true,"条主题") %> </div></td> </tr> </table></td> </tr> </table> <% end if%> <%else set rsw=server.createobject("adodb.recordset") sql="select * from mybook order by time desc" rsw.open sql,conn,1,1 if rsw.eof or rsw.bof then%> <table width="725" align="center"> <tr> <td width="625" align="center" bgcolor="#B4D3E4"><p class="style1">暂时没有留言 <a href="index.asp">发表留言</a> </td> </tr> </table> <%else%> <table width="671" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="669" height="313"> <table width="670" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#7EBEC0" class=k1> <tr> <td width="228" height="31">返回首页||<a href="rword.asp">查看留言</a>||<a href="login.asp">管理登陆</a>||<a href="index.asp">发表留言</a></td> <td width="18"><img src="image/search.gif" width="15" height="12"> </td> <td width="316"><form action="rword.asp" method="post" name="form2" onsubmit="return sarch()"> <input name="ttc" type="text" class="text"> <input type="radio" name="search" value="1" checked> 姓名 <input type="radio" name="search" value="2"> 标题 <input name="Submit" type="submit" class="text" value="查找"> </form></td> <td width="104"></td> </tr> </table> <% rsw.pagesize=5 page=request("page") if page="" or page<1 then page=1 if page>rsw.pagecount then page=rsw.pagecount end if end if rsw.absolutepage=page i=0 do while not rsw.eof and i<rsw.pagesize%> <table width="670" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#0099FF" class="k1" > <tr bgcolor="#FFFFFF" class=k1> <td height="19" bgcolor="#EDF3FF">作者: <%if rsw("name")<>"" then%> <%=rsw("name")%> <%else response.write("匿名") end if%> </td> <td width="460" height="19" bgcolor="#EDF3FF"><img src="image/qq.gif" width="16" height="16" alt="<%=rsw("qq")%>"> <a href="">mailt<%=rsw("email")%>"><img src="image/mail.gif" width="16" height="16" border=0> </a><a href=<%=rsw("homepage")%>><img src="image/home.gif" width="16" height="16" border=0></a>来自:<%=rsw("ip")%></td> </tr> <tr bgcolor="#FFFFFF"> <td width="202" height="148" valign="top" bgcolor="#EDF3FF"><%if rsw("sex")="male" then%> <img src="sex/boy.gif" width="23" height="21"> <%else%> <img src="sex/girl.gif"> <%end if%></br> <br><img src="image/<%=rsw("face")%>"><%=rsw("time")%></td> <td valign="top" bgcolor="#EDF3FF" > 标题:<%=rsw("title")%> <hr align="left" width=100 size=1px noshade> </br> <img src="fpic/<%=rsw("fpic")%>"><%=cpic(rsw("word"))%> </td> </tr> </table> <%i=i+1 rsw.movenext loop %> <table width="537" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="446" height="54" valign="top"><p>共<%=rsw.pagecount%>页,共有<%=rsw.recordcount%>条,你当前在第<%=page%>页,<%=page%>/<%=rsw.pagecount%> <%if page>1 then%> <a href=rword.asp?page=<%=1%> class="v1">[首页]</a> <%else%> [首页] <%end if%> <%if page>1 then%> <a href=rword.asp?page=<%=page-1%> class="v1">[上一页]</a> <%else%> [上一页] <%end if%> <% if not rsw.eof then%> <a href=rword.asp?page=<%=page+1%> class="v1">[下一页]</a> <%else%> [下一页] <%end if%> <% if not rsw.eof then%> <a href=rword.asp?page=<%=rsw.pagecount%> class="v1">[尾页]</a> <%else%> [尾页] <%end if%> </td> <td width="88" valign="top"><form name="form1" method="post" action="rword.asp"> <select name="page" size="1"> <% for i=1 to rsw.pagecount%> <option value="<%=i%>" <% if i=page then%>selected<%end if%>><%=i%></option> <%next%> </select> <input name="Submit" type="submit" class="k1" value="跳转"> </form></td> </tr> </table></td> </tr> </table> <%end if%> <%end if %> </body> </html>

不管我怎么试,得到查询的的只能显示第一页,当我转到第2页的时候,他变成显示了所有留言的显示页面。(查询和显示所有在同一个页面) 谢谢帮我,我已经试了很多次了,实在不知道怎么办,我还盗用了别人的分页技术。

搜索更多相关主题的帖子: javascript function 输入关键字 include search 
2005-06-20 23:42
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
得分:0 

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!--#include file="conn.asp"--> <!--#include file="inc/strchk.asp"--> <!--#include file="inc/mypage.asp"--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script language="javascript"> function sarch() { var x=document.form2.ttc if (x.value=="") { alert("请输入关键字") x.focus() return false } return true } function sea() { window.open('search.asp','sea','height=150,width=460,top=0,left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no') } </script> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>查看留言</title> <link rel=stylesheet type="text/css" href="css/my.css"> </head> <body background="image/205.gif" topmargin="0px"> <% search=request("search") ttc=trim(request("ttc")) if request.form("submit")="查找" then set rst=server.createobject("adodb.recordset") select case search case 1 sqlt="select * from mybook where name like '%"&strchk(ttc)&"%' order by time desc" case 2 sqlt="select * from mybook where title like '%"&strchk(ttc)&"%' order by time desc" end select rst.open sqlt,conn,1,1 %><%if rst.eof or rst.bof then%>

<div align="center">没找到你要的信息<a href=rword.asp>返回</a></div> <%else%> <table width="671" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="669" height="313"> <table width="410" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#00CCFF"> <tr> <td width="410" align="center">共搜索到<%=rst.recordcount%>篇文章<font color=#FF0066><%=search>我想要这里显示标题和姓名,但他只显示1和2,把那个value设为中文会出错. </font>符合,关键词:<font color=#FF0066><%=ttc%></font><a href="rword.asp">显示所有留言</a></td> </tr> </table> <table width="670" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#7EBEC0" class=k1> <tr> <td width="228" height="31">返回首页||<a href="rword.asp">查看留言</a>||<a href="login.asp">管理登陆</a>||<a href="index.asp">发表留言</a></td> <td width="18"><img src="image/search.gif" width="15" height="12"> </td> <td width="316"><form action="rword.asp" method="post" name="form2" onsubmit="return sarch()"> <input name="ttc" type="text" class="text"> <input type="radio" name="search" value="1" checked> 姓名 <input type="radio" name="search" value="2"> 标题 <input name="Submit" type="submit" class="text" value="查找"> </form></td> <td width="104"></td> </tr> </table> <% url="rword.asp?search="&search&"ttc="&ttc rst.pagesize=3 PageNo=request("PageNo") if PageNo="" or PageNo=0 then PageNo=1 rst.AbsolutePage=PageNo TSum=rst.pagecount maxperpage=rst.pagesize PageNo=PageNo+1 PageNo=PageNo-1 if CINT(pageno)>1 then if CINT(pageno)>CINT(TSum) then response.Write("对不起没有您想要的页数") Response.End end if end if if PageNo<0 then response.Write("没有这一页!") Response.End End if i=0 do while not rst.eof and i<rst.pagesize%> <table width="670" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#0099FF" class="k1" > <tr bgcolor="#FFFFFF" class=k1> <td height="19" bgcolor="#EDF3FF">作者: <%if rst("name")<>"" then%> <%=rst("name")%> <%else response.write("匿名") end if%> </td> <td width="460" height="19" bgcolor="#EDF3FF"><img src="image/qq.gif" width="16" height="16" alt="<%=rst("qq")%>"> <a href="mailt<%=rst("email")%>"><img src="image/mail.gif" width="16" height="16" border=0> </a><a href=<%=rst("homepage")%>><img src="image/home.gif" width="16" height="16" border=0></a>来自:<%=rst("ip")%></td> </tr> <tr bgcolor="#FFFFFF"> <td width="202" height="148" valign="top" bgcolor="#EDF3FF"><%if rst("sex")="male" then%> <img src="sex/boy.gif" width="23" height="21"> <%else%> <img src="sex/girl.gif"> <%end if%></br> <br><img src="image/<%=rst("face")%>"><%=rst("time")%></td> <td valign="top" bgcolor="#EDF3FF" > 标题:<%=rst("title")%> <hr align="left" width=100 size=1px noshade> </br> <img src="fpic/<%=rst("fpic")%>"><%=cpic(rst("word"))%> </td> </tr> </table> <%i=i+1 rst.movenext loop %> <table width="537" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td height="23" valign="top"> <div align="right"> <% call showpage(url,rst.RECORDCOUNT,maxperpage,false,true,"条主题") %> </div></td> </tr> </table></td> </tr> </table> <% end if%> <%else set rsw=server.createobject("adodb.recordset") sql="select * from mybook order by time desc" rsw.open sql,conn,1,1 if rsw.eof or rsw.bof then%> <table width="725" align="center"> <tr> <td width="625" align="center" bgcolor="#B4D3E4"><p class="style1">暂时没有留言 <a href="index.asp">发表留言</a> </td> </tr> </table> <%else%> <table width="671" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="669" height="313"> <table width="670" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#7EBEC0" class=k1> <tr> <td width="228" height="31">返回首页||<a href="rword.asp">查看留言</a>||<a href="login.asp">管理登陆</a>||<a href="index.asp">发表留言</a></td> <td width="18"><img src="image/search.gif" width="15" height="12"> </td> <td width="316"><form action="rword.asp" method="post" name="form2" onsubmit="return sarch()"> <input name="ttc" type="text" class="text"> <input type="radio" name="search" value="1" checked> 姓名 <input type="radio" name="search" value="2"> 标题 <input name="Submit" type="submit" class="text" value="查找"> </form></td> <td width="104"></td> </tr> </table> <% rsw.pagesize=5 page=request("page") if page="" or page<1 then page=1 if page>rsw.pagecount then page=rsw.pagecount end if end if rsw.absolutepage=page i=0 do while not rsw.eof and i<rsw.pagesize%> <table width="670" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#0099FF" class="k1" > <tr bgcolor="#FFFFFF" class=k1> <td height="19" bgcolor="#EDF3FF">作者: <%if rsw("name")<>"" then%> <%=rsw("name")%> <%else response.write("匿名") end if%> </td> <td width="460" height="19" bgcolor="#EDF3FF"><img src="image/qq.gif" width="16" height="16" alt="<%=rsw("qq")%>"> <a href="mailt<%=rsw("email")%>"><img src="image/mail.gif" width="16" height="16" border=0> </a><a href=<%=rsw("homepage")%>><img src="image/home.gif" width="16" height="16" border=0></a>来自:<%=rsw("ip")%></td> </tr> <tr bgcolor="#FFFFFF"> <td width="202" height="148" valign="top" bgcolor="#EDF3FF"><%if rsw("sex")="male" then%> <img src="sex/boy.gif" width="23" height="21"> <%else%> <img src="sex/girl.gif"> <%end if%></br> <br><img src="image/<%=rsw("face")%>"><%=rsw("time")%></td> <td valign="top" bgcolor="#EDF3FF" > 标题:<%=rsw("title")%> <hr align="left" width=100 size=1px noshade> </br> <img src="fpic/<%=rsw("fpic")%>"><%=cpic(rsw("word"))%> </td> </tr> </table> <%i=i+1 rsw.movenext loop %> <table width="537" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="446" height="54" valign="top"><p>共<%=rsw.pagecount%>页,共有<%=rsw.recordcount%>条,你当前在第<%=page%>页,<%=page%>/<%=rsw.pagecount%> <%if page>1 then%> <a href=rword.asp?page=<%=1%> class="v1">[首页]</a> <%else%> [首页] <%end if%> <%if page>1 then%> <a href=rword.asp?page=<%=page-1%> class="v1">[上一页]</a> <%else%> [上一页] <%end if%> <% if not rsw.eof then%> <a href=rword.asp?page=<%=page+1%> class="v1">[下一页]</a> <%else%> [下一页] <%end if%> <% if not rsw.eof then%> <a href=rword.asp?page=<%=rsw.pagecount%> class="v1">[尾页]</a> <%else%> [尾页] <%end if%> </td> <td width="88" valign="top"><form name="form1" method="post" action="rword.asp"> <select name="page" size="1"> <% for i=1 to rsw.pagecount%> <option value="<%=i%>" <% if i=page then%>selected<%end if%>><%=i%></option> <%next%> </select> <input name="Submit" type="submit" class="k1" value="跳转"> </form></td> </tr> </table></td> </tr> </table> <%end if%> <%end if %> </body> </html>

不管我怎么试,得到查询的的只能显示第一页,当我转到第2页的时候,他变成显示了所有留言的显示页面。(查询和显示所有在同一个页面) 谢谢帮我,我已经试了很多次了,实在不知道怎么办,我还盗用了别人的分页技术。


中国人的财富网:http://www..cn/
2005-06-20 23:48
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
得分:0 

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!--#include file="conn.asp"--> <!--#include file="inc/strchk.asp"--> <!--#include file="inc/mypage.asp"-->'这是其中的一个分页, <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script language="javascript"> function sarch() { var x=document.form2.ttc if (x.value=="") { alert("请输入关键字") x.focus() return false } return true } </script> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>查看留言</title> <link rel=stylesheet type="text/css" href="css/my.css"> </head> <body background="image/205.gif" topmargin="0px"> <% search=request("search") ttc=trim(request("ttc")) if request.form("submit")="查找" then set rst=server.createobject("adodb.recordset") select case search case 1 title="按姓名查找" sqlt="select * from mybook where name like '%"&strchk(ttc)&"%' order by time desc" case 2 title="按标题查找" sqlt="select * from mybook where title like '%"&strchk(ttc)&"%' order by time desc" end select rst.open sqlt,conn,1,1 %><%if rst.eof or rst.bof then%>

<div align="center">没找到你要的信息<a href=rword.asp>返回</a></div> <%else%> <table width="671" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="669" height="313"> <table width="410" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#00CCFF"> <tr> <td width="410" align="center">共搜索到<%=rst.recordcount%>篇文章<font color=#FF0066><%=title%> </font>符合,关键词:<font color=#FF0066><%=ttc%></font><a href="rword.asp">显示所有留言</a></td> </tr> </table> <table width="670" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#7EBEC0" class=k1> <tr> <td width="228" height="31">返回首页||<a href="rword.asp">查看留言</a>||<a href="login.asp">管理登陆</a>||<a href="index.asp">发表留言</a></td> <td width="18"><img src="image/search.gif" width="15" height="12"> </td> <td width="316"><form action="rword.asp" method="post" name="form2" onsubmit="return sarch()"> <input name="ttc" type="text" class="text"> <input type="radio" name="search" value="1" checked> 姓名 <input type="radio" name="search" value="2"> 标题 <input name="Submit" type="submit" class="text" value="查找"> </form></td> <td width="104"></td> </tr> </table> <% url="rword.asp?search="&search&"ttc="&ttc,这是URL地址。当我查找的时候能显示具体的记录和第一页,但当我转到第2页的时候,变成了显示所有留言的第2页。rst.pagesize=3 PageNo=request("PageNo") if PageNo="" or PageNo=0 then PageNo=1 rst.AbsolutePage=PageNo TSum=rst.pagecount maxperpage=rst.pagesize PageNo=PageNo+1 PageNo=PageNo-1 if CINT(pageno)>1 then if CINT(pageno)>CINT(TSum) then response.Write("对不起没有您想要的页数") Response.End end if end if if PageNo<0 then response.Write("没有这一页!") Response.End End if i=0 do while not rst.eof and i<rst.pagesize%> <table width="670" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#0099FF" class="k1" > <tr bgcolor="#FFFFFF" class=k1> <td height="19" bgcolor="#EDF3FF">作者: <%if rst("name")<>"" then%> <%=rst("name")%> <%else response.write("匿名") end if%> </td> <td width="460" height="19" bgcolor="#EDF3FF"><img src="image/qq.gif" width="16" height="16" alt="<%=rst("qq")%>"> <a href="screen.width-500)this.style.width=screen.width-500;">mailt<%=rst("email")%>"><img src="image/mail.gif" width="16" height="16" border=0> </a><a href=<%=rst("homepage")%>><img src="image/home.gif" width="16" height="16" border=0></a>来自:<%=rst("ip")%></td> </tr> <tr bgcolor="#FFFFFF"> <td width="202" height="148" valign="top" bgcolor="#EDF3FF"><%if rst("sex")="male" then%> <img src="sex/boy.gif" width="23" height="21"> <%else%> <img src="sex/girl.gif"> <%end if%></br> <br><img src="image/<%=rst("face")%>"><%=rst("time")%></td> <td valign="top" bgcolor="#EDF3FF" > 标题:<%=rst("title")%> <hr align="left" width=100 size=1px noshade> </br> <img src="fpic/<%=rst("fpic")%>"><%=cpic(rst("word"))%> </td> </tr> </table> <%i=i+1 rst.movenext loop %> <table width="537" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td height="23" valign="top"> <div align="right"> <% call showpage(url,rst.RECORDCOUNT,maxperpage,false,true,"条主题") %> </div></td> </tr> </table></td> </tr> </table> <% end if%>'这是当按查找按钮的时候会显示的留言<%else set rsw=server.createobject("adodb.recordset") sql="select * from mybook order by time desc" rsw.open sql,conn,1,1 if rsw.eof or rsw.bof then%> <table width="725" align="center"> <tr> <td width="625" align="center" bgcolor="#B4D3E4"><p class="style1">暂时没有留言 <a href="index.asp">发表留言</a> </td> </tr> </table> <%else%> <table width="671" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="669" height="313"> <table width="670" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#7EBEC0" class=k1> <tr> <td width="228" height="31">返回首页||<a href="rword.asp">查看留言</a>||<a href="login.asp">管理登陆</a>||<a href="index.asp">发表留言</a></td> <td width="18"><img src="image/search.gif" width="15" height="12"> </td> <td width="316"><form action="rword.asp" method="post" name="form2" onsubmit="return sarch()"> <input name="ttc" type="text" class="text"> <input type="radio" name="search" value="1" checked> 姓名 <input type="radio" name="search" value="2"> 标题 <input name="Submit" type="submit" class="text" value="查找"> </form></td> <td width="104"></td> </tr> </table> <% rsw.pagesize=5 page=request("page") if page="" or page<1 then page=1 if page>rsw.pagecount then page=rsw.pagecount end if end if rsw.absolutepage=page i=0 do while not rsw.eof and i<rsw.pagesize%> <table width="670" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#0099FF" class="k1" > <tr bgcolor="#FFFFFF" class=k1> <td height="19" bgcolor="#EDF3FF">作者: <%if rsw("name")<>"" then%> <%=rsw("name")%> <%else response.write("匿名") end if%> </td> <td width="460" height="19" bgcolor="#EDF3FF"><img src="image/qq.gif" width="16" height="16" alt="<%=rsw("qq")%>"> <a href="screen.width-500)this.style.width=screen.width-500;">mailt<%=rsw("email")%>"><img src="image/mail.gif" width="16" height="16" border=0> </a><a href=<%=rsw("homepage")%>><img src="image/home.gif" width="16" height="16" border=0></a>来自:<%=rsw("ip")%></td> </tr> <tr bgcolor="#FFFFFF"> <td width="202" height="148" valign="top" bgcolor="#EDF3FF"><%if rsw("sex")="male" then%> <img src="sex/boy.gif" width="23" height="21"> <%else%> <img src="sex/girl.gif"> <%end if%></br> <br><img src="image/<%=rsw("face")%>"><%=rsw("time")%></td> <td valign="top" bgcolor="#EDF3FF" > 标题:<%=rsw("title")%> <hr align="left" width=100 size=1px noshade> </br> <img src="fpic/<%=rsw("fpic")%>"><%=cpic(rsw("word"))%> </td> </tr> </table> <%i=i+1 rsw.movenext loop %> <table width="537" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <td width="446" height="54" valign="top"><p>共<%=rsw.pagecount%>页,共有<%=rsw.recordcount%>条,你当前在第<%=page%>页,<%=page%>/<%=rsw.pagecount%> <%if page>1 then%> <a href=rword.asp?page=<%=1%> class="v1">[首页]</a> <%else%> [首页] <%end if%> <%if page>1 then%> <a href=rword.asp?page=<%=page-1%> class="v1">[上一页]</a> <%else%> [上一页] <%end if%> <% if not rsw.eof then%> <a href=rword.asp?page=<%=page+1%> class="v1">[下一页]</a> <%else%> [下一页] <%end if%> <% if not rsw.eof then%> <a href=rword.asp?page=<%=rsw.pagecount%> class="v1">[尾页]</a> <%else%> [尾页] <%end if%> </td> <td width="88" valign="top"><form name="form1" method="post" action="rword.asp"> <select name="page" size="1"> <% for i=1 to rsw.pagecount%> <option value="<%=i%>" <% if i=page then%>selected<%end if%>><%=i%></option> <%next%> </select> <input name="Submit" type="submit" class="k1" value="跳转"> </form></td> </tr> </table></td> </tr> </table> <%end if%> <%end if %>'这是不查找的时候显示所有内容</body> </html> 非常感谢无根泉哥哥,你上面帮我说的那个显示姓名或标题的已经解决了, 下面你说的那个分页是不查找显示的,麻烦你在帮我看一下,真的非常谢谢你。 我上面写的代码好乱啊 if .......then 显示查找留言 else 查示全部留言. end if 我想问一下无根泉哥哥有没有更好的方法.

[此贴子已经被作者于2005-6-21 21:22:21编辑过]


中国人的财富网:http://www..cn/
2005-06-21 21:08
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
得分:0 
这个其实是使用同一个分页技术吗? http://61.184.204.175你看看查询的时候转到下一页就不行了

[此贴子已经被作者于2005-6-22 13:05:25编辑过]


中国人的财富网:http://www..cn/
2005-06-22 13:04
caiyakang
Rank: 2
等 级:新手上路
威 望:5
帖 子:2111
专家分:0
注 册:2005-3-24
收藏
得分:0 
可以用了,谢谢啊,
我加了submit=request("submit")
我这些代码好像过多,请高手帮我指点了下更好的方法,减少代码。

中国人的财富网:http://www..cn/
2005-06-23 18:15
快速回复:这个问题我一星期没睡好了。
数据加载中...
 
   



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

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