要求生成50条换一页;
文章内容分页标记为"[123]"
,可自动创建文件夹,用fso生成。网上的拉圾代码不要贴。解决给100分
要求生成50条换一页;
文章内容分页标记为"[123]"
,可自动创建文件夹,用fso生成。网上的拉圾代码不要贴。解决给100分
就把所有的页面都贴给你吧
你 自己改 你说的 50条太长了 这里就4 条
这里的分页标记为<hr> 你自己改下
就是下面这句 you wt 有问题找我
fout.writeline "<hr>"
-----
文件版留言板
inpyt.htm 留言输入界面
handle.asp 留言处理保存页面
displaylyb.asp 留言显示页面
lyb.txt 留言保存wenj文件
1 input.htm代码
<table border="1" cellpadding="4" cellspacing="0" width="100%"> <tr><td align="center"><font size="+2" color="#000080"><b>留言表单</b></font></td></tr>
</table> <form action="handle.asp" method="post"> <table border="1" width="100%"> <tr> <td><font color="#000080">姓名:</font></td> <td><input type="text" name="name" size="40" /></td> </tr> <tr> <td><font color="#000080">email:</font></td> <td><input type="text" name="email" size="40" /></td> </tr> <tr> <td><font color="#000080">主题:</font></td> <td><input type="text" name="subject" size="40" /></td> </tr> <tr> <td><font color="#000080">留言:</font></td> <td><textarea name="memo" rows="6" cols="40"></textarea></td> </tr> </table>
<div align="center"> <table width="100%"> <tr align="center"> <td><input type="submit" name="send" value="提交留言" /></td> <td><a href="displaylyb.asp">查看留言</a></td> <td><input type="reset" value="清楚重写" /></td> </tr> </table></div> </form>
2 handle.asp 代码
<% '读取个输入框的数据 name=request("name") email=request("email") subject=request("subject") memo=request("memo") '检查各输入框是否有数据 if name="" or email="" or subject="" or memo="" then response.Write("输入框不能为空白") response.End() end if '第一行包含“姓名”与“email” line1="留言人:"&name line1=line1&string(5," ") '插入5个汉字空格 email="<a href=mailto:"&email&">"&email&"</a>" line1=line1&"email-"&email&"<br>" '第2行 line2="主题:"&subject&"<br>" '第3行为“留言”,先将留言中的换行符vbcrlf换成<br> line3="<table border=0 bgcolor='orange'><tr><td>" line3=line3&memo&"</td></tr></table>" '第4行为留言"时间" line4="时间:"&now() on error resume next '忽略所有的错误 '建立filesystemobject对象 set fso=server.CreateObject("scripting.filesystemobject") application.Lock() '取得gblook.txt 及 gblookld.txt 的完整路径 filepath=server.MapPath("lyb.txt") oldfilepath=server.MapPath("lybold.txt") '将lyb.txt更名为lybold.txt fso.movefile filepath,oldfilepath '打开lybold.txt set fin=fso.opentextfile(oldfilepath, ,true) '建立lyb.txt set fout=fso.createtextfile(filepath) '写入访问者留言 fout.writeline line1 fout.writeline line2 fout.writeline line3 fout.writeline line4 fout.writeline "<hr>" '1次读取整个lybold.txt,然后写入lyb.txt fout.writeline fin.readall '关闭lybold.txt fin.close '删除lybold.txt fso.deletefile oldfilepath,true application.UnLock() '将留言导致“浏览留言”的网页 response.Redirect "displaylyb.asp" %>
3 displaylyb.asp代码
<h2 align="center">留言簿</h2> <%set myadvertise=server.CreateObject("mswc.adrotator") %> <center><%=myadvertise.GetAdvertisement("ad.txt")%></center> <hr width="100%" /> <!--#include file="lyb.txt"--> <a href="input.htm"><p align="center">返回留言表单</p></a>