请教关于静态长文章分页的问题?
现在的代码是这样的。可以把文章生成如news.html,news_1.html,但是文章的内容却没有分开,第个页面都一样。还有我的分页,可以通过几个分页符生成相应几个页面,但是分页链接只有“上一页”“下一页”,链接地址也没有变。请前辈们指教一下,谢谢。<%
//获取静态文件名
fname = makefilename(now()) //makefilename为自定义函数
folder = "../news/"&left(fname,7)&"/"
filepath = folder&fname
html_names = replace(filepath,"../","")
html_name=html_names&".html"
html_name_p = replace(filepath,".html","")
ContentStr=split(body,"||")//分页符
PageNumber=ubound(ContentStr)
for p=0 to ubound(ContentStr)
//打开模板代码,并将其中特殊代码转变为接受值
sql1="select mb_id,mb_body from new_mb where mb_id=2"
set rs1=Server.CreateObject("adodb.recordset")
rs1.open sql1,conn,1,1
mb_code=rs1("mb_body")
rs1.close
set rs1=nothing
conn.close
set conn=nothing
body=htmlencode(ContentStr(p))
mb_code=replace(mb_code,"$htmlbody$",body)
mb_code=replace(mb_code,"$htmlbody$",body)
mb_code=replace(mb_code,"$htmltitle$",n_title)
mb_code=replace(mb_code,"$htmlfor$",n_from)
mb_code=replace(mb_code,"$htmladmin_xm$",admin_xm)
mb_code=replace(mb_code,"$htmlclass_name$",class_name)
mb_code=replace(mb_code,"$htmlask$",sky)
//分页
if PageNumber>0 then
MyPagerTable="<table width=""60%"" border=""0"" cellpadding=""0"" cellspacing=""1""><tr><td height=""25""><a href=""$UrlUp""><font color=""ff0000""><strong>[上一页]</strong></font></a></td><td height=""30""><a href=""$UrlDown""><font color=""ff0000""><strong>[下一页]</strong></font></a></td></tr></table>" //下一页代码,用于替换
if p<=1 then
MyPagerTable=replace(MyPagerTable,"$UrlUp","../"&filepath&".html")
if p=PageNumber then
MyPagerTable=replace(MyPagerTable,"$UrlDown","../"&filepath&"_"&p&".html")
else
MyPagerTable=replace(MyPagerTable,"$UrlDown","../"&filepath&"_"&p+1&".html")
end if
else
MyPagerTable=replace(MyPagerTable,"$UrlUp","../"&filepath&"_"&p-1&".html")
if p=PageNumber then
MyPagerTable=replace(MyPagerTable,"$UrlDown","../"&filepath&"_"&p&".html")
else
MyPagerTable=replace(MyPagerTable,"$UrlDown","../"&filepath&"_"&p+1&".html")
end if
end if
mb_code=replace(mb_code,"$MyPager$",MyPagerTable)
else
mb_code=replace(mb_code,"$MyPager$","")
end if
//生成页面
Set fso = Server.CreateObject("Scripting.FileSystemObject")
On Error Resume Next //容错处理
fso.CreateFolder(Server.MapPath(folder))
if p=0 then
Set fout = fso.CreateTextFile(Server.MapPath(filepath&".html"))
else
Set fout = fso.CreateTextFile(Server.MapPath(filepath&"_"&p&".html"))
end if
fout.WriteLine mb_code
fout.close
next
%>
sbody=htmlencode(ContentStr(p))里的P不循环,而生成页面里的P却循环,请问怎么回事?