日期:2014-05-17  浏览次数:20900 次

郁闷了几天,问个form传送动态参数的问题
我做了一个留言板.index.asp内嵌了一个显示分页的showpaged.asp

控制分页的链接,如:首页,上一页...放在index.asp中.要通过form把page(页号)传给showpaged.asp,

<form   action= "showpaged.asp?page= <%page%> "   method= "get "   target= "pagedwindows ">

不知道这样写对不对?

------解决方案--------------------

showpaged.asp
------------------------------------------------------

<!--#include file= "conn.asp "-->

<% response.Write(request( "page "))
strsql= "select * from book order by ID desc "
set rs=server.createobject( "ADODB.RECORDSET ")
rs.open strsql,conn,1,3
rs.pagesize=5
page=Clng(request.QUERYSTRING( "page "))
if page <1 then page=1
if page> rs.pagecount then page=rs.pagecount
rs.absolutepage=page
%>
<html>
<head>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<title> 无标题文档 </title>
<style type= "text/css ">
<!--
body {background:none white;margin:0 0 0 0}
body,table,td {font-size:12px}
.style1 {color: #FF0000}
-->
</style>
</head>

<body>
<table cellspacing= "5 " cellpadding= "2 " border= "0 ">
<tr> <td>
<table width= "99% " border= "0 " cellspacing= "1 " cellpadding= "0 " align= "center ">
<%
for i=1 to rs.pagesize
%>
<tr style= "background:none white ">
<td height= "20 " bgcolor= "#CCCCCC "> 主题: <%=rs( "Subject ")%> </td>
</tr>
<tr style= "background:none white ">
<td height= "20 " style= "text-indent:2em "> <%=rs( "Content ")%> </td>
</tr>
<tr style= "background:none white ">
<td height= "20 "> 作者: <%=rs( "UserName ")%> <%=space(1)%> QQ: <%=rs( "QQ ")%> <%=space(1)%> Email: <%=rs( "Email ")%> <%=space(1)%> 主页: <%=rs( "HomePage ")%> <%=space(1)%> 发表于: <%=rs( "CreateDate ")%> </td>
</tr>
<tr style= "background:none white ">
<td height= "1px "> </td>
</tr>
<%
if session( "admin ")= "liqiang665 " then
%>
<tr style= "background:none white ">
<td height= "1px " style= "background:none #4C4212 "> <a href= "del.asp?ID= <%=rs( "ID ")%> "> 删除 </a> </td>
</tr>
<%
end if
rs.movenext
if rs.eof or rs.bof then Exit for
next


psString= " "

'首页
if page=1 then
psString=psString+ "首页 "&space(1)
else
psString=psString+ " <a href=javascript:gogo(1);> 首页 </a> "&space(1)
end if
'----------------上一页
if page=1 then
psString=psString+ "上一页 "&space(1)
else
psString=psString+ " <a href=javascript:gogo( "&page-1& ");> 上一页 </a> "&space(1)
end if
'--------------下一页
if page=rs.pagecount then
psString=psString