How can I use ASP to output HTML files?

Source: Internet
Author: User

<! -- # Include file = "top. inc" -->
<%
U_title = request. form ("u_title ")

'Check whether the title is entered.
If u_title = "" then
%>
<Form method = "POST" action = "<% = request. servervariables (" script_name ") %>">
<! --The input box is displayed when no title is entered.-->

<P>File title<Br>
<Input type = "text" name = "u_title" size = "35"> </p>
<P> Font Size <br>
<Select size = "1" name = "u_text_size">
<Option selected value = "1"> 1 </option>
<Option value = "2"> 2 </option>
<Option value = "3"> 3 </option>
<Option value = "4"> 4 </option>
<Option value = "5"> 5 </option>
<Option value = "6"> 6 </option>

</Select> </p>
<P>The1Segment<Br>
<Textarea rows = "2" name = "u_paragraph1" cols = "35"> </textarea> </p>
<P>The2Segment<Br>
<Textarea rows = "2" name = "u_paragraph2" cols = "35"> </textarea> <input type = "submit" value ="Submit"> </P>
</Form>
<%
End if
%>

<%
If u_title <> "" then
U_title = request. form ("u_title ")
U_paragraph1 = request. form ("u_paragraph1 ")
U_paragraph2 = request. form ("u_paragraph2 ")
U_text_color = request. form ("u_text_color ")
U_text_size = request. form ("u_text_size ")
G_filename = replace (u_title ,"","_")

'If a user has entered a title,Obtains all user input content..

Set fso = createobject ("scripting. filesystemobject ")
Set act = fso. createTextFile (server. mappath ("write2htm/" & g_filename & "-" & month (date () & day (date () & year (date ())&". htm "), true)
'CreateCreate the text (html) fileFile to server,And addMmddyyyyFormat: year, month, and day.

'Write all user inputText (html)File,. HtmExtension files can be easily converted into what your website needs most.. AspOr. IncFile.
Act. WriteLine "Act. WriteLine chr (13)
Act. WriteLine "<title>" & u_title & "</title>"
Act. WriteLine chr (13)
Act. WriteLine "<body bgcolor = '# ffff'>"
Act. WriteLine chr (13)
Act. WriteLine "<p align = 'center'> <font face = 'arial' size = '" & u_text_size & "'>"
Act. WriteLine chr (13)
Act. WriteLine u_title & "</p>"
Act. WriteLine chr (13)
Act. WriteLine "<p align = 'left'> <font face = 'arial' size = '" & u_text_size & "'>"
Act. WriteLine chr (13)
Act. WriteLine u_paragraph1 & "</p>"
Act. WriteLine chr (13)
Act. WriteLine "<p align = 'left'> <font face = 'arial' size = '" & u_text_size & "'>"
Act. WriteLine chr (13)
Act. WriteLine u_paragraph2 & "</p>"
Act. WriteLine chr (13)
Act. WriteLine "<p> </p>"
Act. WriteLine "<p align = 'center'> <font face = 'arial' size = '" & u_text_size & "'>"
Act. WriteLine"This file is created! "
Act. WriteLine now () & "</p>"
Act. Close

'Close file.
%>
Your page has been successfully created!Click to view.
<A href = "write2htm/<% = g_filename &"-"& month (date () & day (date () & year (date () %>. htm"
Target = "_ blank">View</A>
<Br>
<Br>
<% Response. write "Response. write chr (13)
Response. write "<title>" & u_title & "</title>"
Response. write chr (13)
Response. write "<body bgcolor = '# ffff'>"
Response. write chr (13)
Response. write "<p align = 'center'> <font face = 'arial' size = '" & u_text_size & "'>"
Response. write chr (13)
Response. write u_title & "</p>"
Response. write chr (13)
Response. write "<p align = 'left'> <font face = 'arial' size = '" & u_text_size & "'>"
Response. write chr (13)
Response. write u_paragraph1 & "</p>"
Response. write chr (13)
Response. write "<p align = 'left'> <font face = 'arial' size = '" & u_text_size & "'>"
Response. write chr (13)
Response. write u_paragraph2 & "</p>"
Response. write chr (13)
Response. write "<p> </p>"
Response. write "<p align = 'center'> <font face = 'arial' size = '" & u_text_size & "'>"
Response. write"This file is created! "
Response. write now () & "</p>"
End if
%>
<! -- # Include file = "bottom. inc" -->

 

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.