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:
<textarea name=body><!--#include file=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!
<%
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
%>
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