asp调用模板生成html----asp文件(更新代码)

asp调用模板生成html----asp文件(更新代码)

ID:8553994

大小:40.00 KB

页数:11页

时间:2018-04-01

asp调用模板生成html----asp文件(更新代码)_第1页
asp调用模板生成html----asp文件(更新代码)_第2页
asp调用模板生成html----asp文件(更新代码)_第3页
asp调用模板生成html----asp文件(更新代码)_第4页
asp调用模板生成html----asp文件(更新代码)_第5页
资源描述:

《asp调用模板生成html----asp文件(更新代码)》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、asp调用模板生成html----asp文件(更新代码)TheASPcalltemplategeneratesthehtml----aspfile(updatedcode)Thursday,December31,2009,05:30p.m."--#includefile="CONN.ASP"-->!

2、-------------------------------'openfileprocedurefunction'FunctionOpenfile(URL)Dim,fileurl,mfile,content,FSOFileurl=Server.MapPath(URL)SetFso=Server.CreateObject('Scripting.Filesystemobject')'definesFSO"Setmfile=Fso.OpenTextFile(fileurl,1)"opensthefileinreadmodeIfNotmfile.AtEndOfStreamThenC

3、ontent=mfile.ReadAll()readallofthecontentEndIfMfile.CloseOpenFile=contentEndFunction'----------------------------------------------------ThelegendaryRS...NoexplanationSetrs=Server.CreateObject("ADODB.RecordSet")SQL="select*,from,Table_News,order,sys_id,DESC,by".Thisisthenameofthenameinmydat

4、abase.PleasechangeitbyyourselfRs.Open,SQL,Conn,1,1'----------------------------------------------------"Tomakeajudgment,thisexampleisonlytoachieveeffect,pleaseincreaseyourownsecuritydetectionRsnum=rs.recordcount'toreadallthedatainthedatabasejusttobeabletodisplaynormallyPage=CInt(request.For

5、m('page'))'takesthenumberofpagesintheformtogenerateFolder=Trim(request.Form("folder")).Createfolderoptionsintheform.Notethatthereisnodetectionhere.It'sasecurityhazard'----------------------------------------------------'userinputundersimplejudgmentIfIsNumeric(page)=falseThen"Response.Writep

6、age&""nonnumeric".Pleasere-enter!"Response.End()ElseIfPage>rsnumThenPage=rsnumEndIfEndIfIfpage="Then"Page=rsnumEndIf'----------------------------------------------------'simplyjudgewhethertousethedefaultfolderIfFolder="Then"Folder="news""EndIf'-----------------------------------------------

7、-----ForI=1,To,page'startprocessingvariableshereandgetresults“----------------------------------------------------“下面的几个赋值变量我就不解释了吧?关键词=RS(“news_keyword”)标题=RS(“news_topic”)身体=RS(“news_content”)底=RS(“news_time”)“删掉不用开始“当时为了做上一篇下一篇的演示,做了左右和美元美元,可以不用“-----

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。