求助:如何实现上一篇,下一篇
asp吧
全部回复
仅看楼主
level 3
<%
dim dbid
dim sql
dbid=request("id")
set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from customer where id="&dbid
rs.open sql,conn,1,3
rs("hit")=rs("hit")+1
rs.update
demo=replace(rs("body"),chr(10)+chr(13),"<br>")
%>
<html xmlns="http://www.w3.org/1999/xhtml">
.................此处省略
<%
set rs=Server.CreateObject("ADODB.Recordset")
sql="select * from customer where id="&dbid
rs.open sql,conn,1,3
%>
<table width="96%" border="0" align="center" cellpadding="0" cellspacing="0" style="font-family:宋体;font-size: 9pt;">
<tr>
<td colspan="3"></td>
</tr>
<tr>
<script language="JavaScript">
function doZoom(size){
document.getElementById('zoom').style.fontSize=size+'pt';
}
</script>
<td width="99%" height="30" align="right" valign="middle" bgcolor="#DBE9F6" style="font-family:宋体;font-size: 9pt;">【<a href="javascript:window.print()">打印</a>】 【<a href="javascript:window.close()" class=black>关闭</a>】</td>
</tr>
<tr>
<td width="99%" height="1"></td>
</tr>
<tr>
<td width="99%" height="1" background="images/line.gif"></td>
</tr>
<tr>
<td width="99%" align="center" valign="middle" height=28><span style="color:000000;font-family:宋体;font-size:12pt;font-weight: bold;letter-spacing: 2pt;"><%=rs("title")%></span>
<table width="100%" align="center">
<tr>
<td height="1" bgcolor="#CCCCCC" width="80%"></td>
</tr>
</table></td>
</tr>
<tr>
<td style="padding-left:5;padding-right:5;line-height: 13pt;font-size:9pt;letter-spacing:0.5pt;" id=zoom><font color="#000000"><%=demo%></font></td>
</tr>
<tr>
<td height="5"><br>
<table width="90%" align="center">
<tr>
<td height="1" bgcolor="#CCCCCC"></td>
</tr>
</table></td>
<tr>
<td height="27" align="right" valign="middle"> <font color="#666666">发表时间:〖</font><font color=#808080><%=rs("data")%></font><font color="#666666">〗</font>  <font color="#666666">本文作者:</font><font color=#ff0000><%=rs("author")%></font>   <font color="#666666">浏览次数:</font><font color=#ff0000><%=rs("hit")%></font> </td>
</tr>
<tr>
<td height="27" align="right" valign="middle"><%
set rs=Server.CreateObject("ADODB.Recordset")
sql="select top 1 * from case where id>"&dbid&" order by id asc"
rs.open sql,conn,1,3
%>
<%do while not rs2.eof%>
<a href="/listcase.asp?id=<%=rs2("id")%>">上一篇</a>
%> :        <%
set rs2=Server.CreateObject("ADODB.Recordset")
sql="select top 1 * from case where id>"&dbid&" order by id desc"
rs2.open sql,conn,1,3
%>
<%do while not rs2.eof%>
<a href="/listcase.asp?id=<%=rs2("id")%>">下一篇</a>
<%
dbid =rs("id")
function Getpre
sql="select top 1 * from case where id>"&dbid&" order by id"
set rs=conn.execute(sql)
if rs.eof or rs.bof then
response.Write("没有新闻了")
else
pid2=rs("id")
response.Write("<a href='listcase.asp?id="&pid2&"'>"&rs("title")&"</a>")
end if
end function
function Getnext
sql="select top 1 * from case where id<"&dbid&" order by id desc"
set rs=conn.execute(sql)
if rs.eof then
response.Write("没有新闻了")
else
pid3=rs("id")
response.Write("<a href='listcase.asp?id="&pid3&"'>"&rs("title")&"</a>")
end if
end function
%>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td><img src="images/mainfg.jpg" width="668" height="14" /></td>
</tr>
</table></td>
</tr>
</table>
<!--#include file="bottom.asp"-->
</body>
</html>
求助,不会调试,不会排版,望大神来解答,谢谢。
2016年03月28日 03点03分 1
level 3
求助
2016年03月28日 05点03分 2
1