| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 635 人关注过本帖
标题:[求助]谁帮我改一下这段代码
取消只看楼主 加入收藏
kirind
Rank: 1
等 级:新手上路
帖 子:44
专家分:0
注 册:2005-10-1
收藏
 问题点数:0 回复次数:0 
[求助]谁帮我改一下这段代码

代码如下:不够完整,当当前是第一页的时候点击上一页应该就是第一页不变,这段代码却是第0页,同样是最后一页时点击下一页连结也有错误。另外我想加一段当没有完整填写信息提交时弹出提示框的代码。不知道该怎么写?希望高手指教。 代码见下面: <%@ CODEPAGE = "936" %> <% thesize=4 pagesize=Request("pagesize") keyword=request("keyword") if request("page")="" then curpage = 1 else curpage = cint(request("page")) end if %> <html>

<head> <script> <!--// var x,y var timer var i_fontsize=0 var step=0 var thisx,thisy function handlerMM(e){ x = (document.layers) ? e.pageX : event.clientX y = (document.layers) ? e.pageY : event.clientY } function ringup() { if (document.all) { thisx = x thisy = y ringup2() } } function ringup2() { if (i_fontsize<=1000) { document.all.ring.style.fontSize=i_fontsize document.all.ring.style.color="rgb(255,"+Math.floor(i_fontsize/6)+","+Math.floor(i_fontsize/6)+")" document.all.ring.style.posLeft=thisx-(Math.floor(i_fontsize/3)) document.all.ring.style.posTop=thisy-(Math.floor(i_fontsize/1.4)) step+=4 i_fontsize+=step timer=setTimeout("ringup(2)",50) } else { clearTimeout(timer) i_fontsize=0 step=0 document.all.ring.style.posTop=-10000 } } document.onmousemove = handlerMM; //--> </script>

<title>幸福纪念册</title> </head> <body background="" >

<!--需修改的部分 开始-->

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="758" id="AutoNumber3"> <tr> <td width="147" valign="top" align=center> <p><br> </td> <td width="585"> <p align="center">  <p style="margin: 0 20" align="center">  </p> <%if Request("msg")<> "" then%> <%end if%> <div align="center"> <center> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#123456" width="90%" id="AutoNumber4" height="153"> <form method=post action="add.asp?keyword=<%=keyword%>&page=<%=curpage%>&pagesize=<%=pagesize%>" id=form1 name=form1> <tr> <td colspan="2" bgcolor="#123456" height="21"> &nbsp; <font color="#DAFDBB"> <font size="3"><b> 宝 贝 日 记</b></font></font></td> </tr> <tr> <td width="28%" align="center" height="130"> <p style="margin-top: 3; margin-bottom: 3"><font color="#4E4F26">&nbsp;天气: <input class="input" name="weather" size="15" style="color: #000000; border-style: solid; border-color: #4E4F26"> </font> <p style="margin-top: 3; margin-bottom: 3"><font color="#4E4F26">&nbsp;心情: <input class="input" name="mood" size="15" style="color: #000000; border-style: solid; border-color: #4E4F26"> </font> <p style="margin-top: 3; margin-bottom: 3"><font color="#4E4F26">&nbsp;主题: <input class="input" name="title" size="15" style="color: #000000; border-style: solid; border-color: #4E4F26"> </font></p></td> <td width="72%" height="130"> <p align="center"> <textarea class="input" rows="6" name="content" cols="58" style="color: #000000; border-style: solid; border-color: #4E4F26"></textarea> <br> &nbsp; <input class="backc" type="submit" value="提 交" name="B1"> <input class="backc" type="reset" value="重 填" name="B1"> </td> </tr> </form> </table> </center> </div></td> </tr> </table> <% if pagesize="0" or pagesize="" then pagesize=thesize set conn=server.createobject("adodb.connection") DBPath = Server.MapPath("baobei.mdb") conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath Set rs = Server.CreateObject("ADODB.Recordset") dim rs, sql set rs = server.createobject("adodb.recordset") dim curpage, strcate if keyword <> "" then keyword = replace(keyword,"'","") '过滤关键字 keyword = replace(keyword,"[","") keyword = trim(keyword) wherestr=" where name like '%" & trim(keyword) & "%' or content like '%" & trim(keyword) & "%' or title like '%" & trim(keyword) & "%'" end if sql = "SELECT * FROM guestbook " & wherestr & " ORDER BY id DESC" rs.open sql, conn, 1, 1 if rs.bof and rs.eof then rs.close response.write "<br><center>还没有符合条件的留言呢!</center>" else dim i rs.pagesize = pagesize if rs.pagecount < curpage then rs.absolutepage=rs.pagecount curpage=rs.pagecount else rs.absolutepage = curpage end if for i = 1 to rs.pagesize %> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="758" id="AutoNumber3"> <tr> <td width="148" valign="top"> </td> <td width="583"> <br> <div align="center"> <center> <table border="1" cellpadding="0" cellspacing="0" bordercolor="#123456" width="90%" id="AutoNumber4" height="102"> <tr> <td height="20" bgcolor="#123456" width="75%"><font color="#DAFDBB">&nbsp; &lt;宝贝日记&gt; &nbsp; [<%=formatdatetime(rs("addtime"),2) & " " & formatdatetime(rs("addtime"),4)%>] &nbsp;&nbsp;&nbsp;&nbsp;主题:<%=rs("title") %> &nbsp;&nbsp;&nbsp;心情:<%=rs("mood") %> &nbsp;&nbsp;&nbsp;天气:<%=rs("weather") %></font></td> </tr> <tr> <td colspan="2" height="79" style="WORD-WRAP: break-word"> <p style="line-height: 140%; margin-left: 15; margin-right: 10; margin-top: 10; margin-bottom: 5" align=left> <font color="#008000"> <% Response.Write changechr(cstr(rs("content"))) if rs("reply")<> "" then %> </font> <p style="line-height: 140%; margin-left: 15; margin-right: 10; margin-top: 10; margin-bottom: 5" align=left><font color="#adbd29">■回复■</font><font color="#008000"><br><font class="fonts"><%=changechr(rs("reply"))%></font> <%end if%> </font> </p></td> </tr> </table> </center> </div> </td> </tr> </table> <% rs.movenext if rs.eof then i = i + 1 exit for end if next %> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="758" id="AutoNumber5"> <tr> <td width="149" valign="top"> </td> <td width="582"> <br> <div align="center"> <center> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#008000" width="90%" id="AutoNumber6"> <tr> <td colspan="2" height="50"> <font color="#008000">当前第<%=(curpage)%>页,共<%=(rs.PageCount)%>页</font> <a href="index.asp?page=1" class="style1">第一页</a>

<a href="index.asp?page=<%=curpage-1%>"class="style1">上一页</a> <a href="index.asp?page=<%=curpage+1%>"class="style1">下一页</a> <a href="index.asp?page=<%=rs.PageCount%>"class="style1">最后页</a> &nbsp; <%for i=1 to rs.pagecount if curpage <> i then%> <a class=a1 href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=i%>&pagesize=<%=pagesize%>&keyword=<%=keyword%>"></a> </font> <a class=a1 href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=i%>&pagesize=<%=pagesize%>&keyword=<%=keyword%>"><font color="#008000">&lt;<%=i%>&gt;</font></a> <font color="#008000"> <%else%> &lt;<%=i%>&gt; <%end if next if Session.Contents("thegbmaster")="yes" then%>  [<a href="logout.asp?page=<%=cstr(curpage)%>&pagesize=<%=pagesize%>&keyword=<%=keyword%>"></a></font><a href="logout.asp?page=<%=cstr(curpage)%>&pagesize=<%=pagesize%>&keyword=<%=keyword%>"><font color="#008000">退出管理</font></a><font color="#008000">] <%end if%></font></td> </tr> </table> </center> </div> </td> </tr> </table> <% rs.close end if set rs=nothing conn.Close set conn=nothing %> </body> </html> <% function changechr(str) changechr=replace(replace(replace(replace(str,"<","&lt;"),">","&gt;"),chr(13),"<br>")," ","&nbsp;") end function %>

搜索更多相关主题的帖子: 代码 var keyword request 
2005-10-21 22:53
快速回复:[求助]谁帮我改一下这段代码
数据加载中...
 
   



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

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