FSO generate static HTML file

Replace FSO generate static HTML files when the template tag has been a very troublesome problem, at least I think so, but also do not do outside a template, trouble! I saw today there is a way to solve this problem

As a normal index.asp page, and washed with ASP code to call up the contents of the database, to create another page makehtml.asp added a textarea field, assumed name = "body", will be adjusted in the textarea index.asp out, such as:
<textarea name = "body"> <-! # the include File = "index.asp" -> </ textarea>, textarea contained in this form, created by FSO object receives the form page, generated index.html file below!

<%
filename="../index.html"
if request("body")<>"" then
set fso = Server.CreateObject("Scripting.FileSystemObject")
set fout = fso.CreateTextFile(server.mappath(""&filename&""))
fout.write request.form("body")
fout.close
set fout=nothing
set fso=nothing
end if
%>

Published 16 original articles · won praise 1 · views 30000 +

Guess you like

Origin blog.csdn.net/wvtjplh/article/details/3889267