The new idea of generating static pages can ignore various complicated problems.

Source: Internet
Author: User

When using FSO to generate an html file, if it contains a template, You need to mention the template, replace the tag, and put the content into it to generate a static page. This is too complicated. Today, we will announce a new idea.

First, create a dynamic file a, such as asp, php, jsp, and so on. This file must have a template style, and also has a function to extract the content to be output, in this case, re-create file B and put only one <textarea> in file B. The <textarea> statement is as follows:
<Textarea name = "content"> <! -- # Include file = "file a" --> </textarea>. Then, include the textarea in the form and create a FSO object on the receive table sheet page. The static file is generated as follows!

<%
StrFilename = "c.html"
Strcontent = InSql (Request. Form ("content "))
If Len (Strcontent) <1 Then
Response. Write "the content to be generated does not exist! "
Response. End ()
End If

Set Fso = Server. CreateObject ("Scripting. FileSystemObject ")
Set CreatFile = Fso. CreateTextFile (server. mappath ("" & StrFilename &""))
CreatFile. write Strcontent
CreatFile. close
Set CreatFile = nothing
Set Fso = Nothing
Response. Write "static page generation is complete! "
%>

This c.html file is generated, and no template is required. You only need to read the dynamic file that is used normally to textarea. No problem has been found yet! The premise is that the server must support FSO.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.