Replacing the template tags when FSO generates static HTML files has always been a very troublesome problem. At least that's what I think, don't make a template, please! , I saw today that there is a way to solve this problem
For example, a normal index.asp page, and use ASP code to call out the contents in the database, create another page of makehtml.asp, add a textarea field, assuming it is name="body", call index.asp out in the textarea, such as:
<textareaname="body"><!--#includefile="index.asp"--></textarea>, include this textarea in the form, and create an FSO object on the receiving form page, and generate the index.html file as follows!
The code copy is as follows:
<%
filename="../index.html"
ifrequest("body")<>""then
setfso=Server.CreateObject("Scripting.FileSystemObject")
setfout=fso.CreateTextFile(server.mappath(""&filename&""))
fout.writerequest.form("body")
fout.close
setfout=nothing
setfso=nothing
endif
%>
In this way, the index.html file is generated, and there is no need for even a template. Just read the ASP file used under normal circumstances into the textarea. No problem has been found yet! Of course, the premise is that the server must support FSO