ASP生成HTML页面问题求救,急啊

BH520_com BH520_com 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
下面的是ASP生成HTML静态页面的代码。现在生成遇到了一点问题,如下:
无法把数据库中所有信息读取出来后按照每页显示8个文件分页生成。现在生成的所有页都是第一页,请大家帮忙看看错在哪里了啊?谢谢。

源代码如下:
--------------------------------------------
<%
'定义ceil函数,用于输出非整数的结果为整数部分+1
function ceil(num)
dim t
t=fix(num)
if num=t then
ceil=t
else
ceil=t+1
end if
end function
'ceil函数结束

dim rs
dim sql
'搜索模板表中的模板
sql="select ListTmp from template where id=1"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
ListTmp=rs("ListTmp")
rs.close

sql_count="select * from teleplay order by ID desc"
end if
rs_count.open sql_tvcount,conn,1,1
if rs_count.eof then
response.Write("还没有任何要生成的页面")
end if

dim TotalFile
dim MaxPerPage
dim TotalPages
dim CurrentPage
'要生成的总文件数
TotalFile=rs_count.recordcount
'设置每列表页显示的文件数
MaxPerPage=8
'自定义函数ceil计算列表页总页数
TotalPages=ceil(TotalFile/MaxPerPage)

for CurrentPage=1 to TotalPages
'每页显示的文件
dim i
i=0
do while not rs_count.eof
i=i+1
PageTitle=PageTitle&" "&rs_count("Title")
TopHits=TopHits&rs_count("Title")&" "
if i>=MaxPerPage then exit do
rs_count.movenext
loop
'替换模板模块中的内容
ListTmp=replace(ListTmp,"{body}",PageBody)

'创建FSO对象
Set fso = Server.CreateObject("Scripting.FileSystemObject")
'设置FOS写入文件的路径和名称
Set fout = fso.CreateTextFile(server.mappath("../list/"¤tPage&".htm"))
fout.Write ListTmp
fout.close
next
%>
...全文
评论 4
收藏 已收藏
分享
返回顶部
BH520_com
ASP 28,401 成员 356,940 内容