大家谁有生成HTML的静态页面分页的程序代码

xiaopar 2005-03-21 09:07:04
我的只是单条信息生成HTML,但是不知道如何使分类页面也生成HTML,更头痛的是就算分类页面生成HTML不知道如何分页,大家谁有这样的代码例子能否提供一个参考一下,不胜感激
...全文
187 9 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
guanjm 2005-03-21
  • 打赏
  • 举报
回复
但这分页也只是不包括搜索结果的分页
TSD 2005-03-21
  • 打赏
  • 举报
回复
读取指定的记录,标记变量,再循环生成
guanjm 2005-03-21
  • 打赏
  • 举报
回复
这样楼主应该明白了吧,你在把分页里的下一页这类改成这样
<% if (pagenum=1) then %>
<FONT size=2><FONT color=#999999>首页</FONT>
<FONT color=#999999>上页</FONT>
<% else %>
<a href="index_1.htm"><FONT size=2><FONT color=#12589e>首页</FONT></a>
<a href="index_<%=pagenum-1%>.htm"><FONT color=#12589e>上页</FONT></a>
<% end if %>
<% if (pagenum=totalpage) then %>
<FONT color=#999999>下页</FONT>
<FONT color=#999999>末页</FONT>
<% else %>
<A href="index_<%=pagenum+1%>.htm"><FONT color=#12589e>下页</FONT></A>
<A href="index_<%=totalpage%>.htm"><FONT color=#12589e>末页</FONT></A>
<% end if%>
就行了
ffyd2000 2005-03-21
  • 打赏
  • 举报
回复
没人办法贴呀,太多了
guanjm 2005-03-21
  • 打赏
  • 举报
回复
<%
function getHTTPPage(url)
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytesToBSTR(Http.responseBody,"GB2312")
set http=nothing
if err.number<>0 then err.Clear
end function

'2、转换乱玛,直接用xmlhttp调用有中文字符的网页得到的将是乱玛,可以通过adodb.stream组件进行转换
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function


for i=1 to 2
txtURL="http://127.0.0.1/new/test.asp?pagenum="&i'server.MapPath("../test.asp?pagenum="&i&"""")
sText = getHTTPPage(txtURL)

Set FileObject=Server.CreateObject("Scripting.FileSystemObject")
filename="../index_"&i&".htm"
Set openFile=FileObject.OpenTextfile(server.mapPath(filename),2,true) 'true为不存在自行建立
openFile.writeline(sText)
Set OpenFile=nothing
next


%>
<script>
alert("静态网页生成完毕");
history.back();
</script>
LIHY70 2005-03-21
  • 打赏
  • 举报
回复
学习中!请贴代码,谢谢!
LIHY70 2005-03-21
  • 打赏
  • 举报
回复
学习中!请贴代码,谢谢!
satans18 2005-03-21
  • 打赏
  • 举报
回复
渐飞新闻系统2.0
ffyd2000 2005-03-21
  • 打赏
  • 举报
回复
这个我也做过,我用的是模板+正则替换。分类也是

28,409

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧