Online Story Solitaire 1 (Turn)

Source: Internet
Author: User
Tags html tags relative visual studio
Library name vote

Table Tbcomment
Userip text
Comment Text

Table Tbvote
Voteid Automatic Numbering
Votechapter text
Votecount Digital

Afterpost.asp
<%@ Language=vbscript%>
<%
' The function of this ASP file is to save the new articles that users have written in the form of a text file.
' New article unified in the relative path to the new1/folder, the new article name has certain rules
' The first one is newchapter1.html, and the second is newchapter2.html according to the article published successively
' Order, considering that can not be unlimited to allow online users to continue to write articles, can generate up to 100 pieces
' The new article contains some HTML tags so that you can connect directly to the file when making the connection
Instead of using the program to read the file and then control the output format, the connection is made using the ContentLink component,
' The application of this component is shown in the following way,
' To take advantage of a text file that has a certain format to describe the connection, this text file is named New.txt
' is also stored under the relative directory new1/
If Request.ServerVariables ("http_method") = "POST" Then
Set Fsys=server. CreateObject ("Scripting.FileSystemObject")
' Get the physical path to the folder
Phypath=server. MapPath ("/project4_local")
If not fsys. FolderExists (Phypath & "/new1") Then
' If the folder that holds the new story section does not exist, create the folder
Fsys. CreateFolder (Phypath & "/new1")
End If
For I=1 to 100
' The new Story section received every day is not greater than 100
If not fsys. FileExists (Phypath & "/new1/newchapter" & I & ". html") Then
Fsys. CreateTextFile ("Newchapter" & I & ". html")
Set Txtfile=fsys. OpenTextFile (Phypath & "/new1/newchapter" & I & ". html", 2,true)
Exit For
End If
Next
' Write submissions to a file
' Write the text file in HTML format, and the browser can read the file directly and display it in a certain format.
Title=request.form ("title")
Author=request.form ("author")
Content=request.form ("content")
Txtfile.writeline "Txtfile.writeline "Txtfile.writeline "<title>" & title & "</title>"
Txtfile.writeline "Txtfile.writeline "<body>"
Txtfile.writeline "<p align=center><font size=4 color=red>" & title & "</font>"
Txtfile.writeline "<font size=2 color=blue> Author:" & author & "</font></p>"
Txtfile.writeline "<pre>" & Content & "</pre>"
Txtfile.writeline "</body>"
Txtfile.writeline "' Close the file
Txtfile.close
Set txtfile=nothing
' The following is a directory to add a new story to the connection file
Set Txtfile=fsys. OpenTextFile (Phypath & "/new1/new.txt", 8,true)
Txtfile.writeline "New1/newchapter" & I & ". html" & "" & I & "chapter:" & Request.Form ("title") &am P "(" & Request.Form ("Author") & ")"
Txtfile.close
' Open the file you just wrote
Set Txtfile=fsys. OpenTextFile (Phypath & "/new1/newchapter" & I & ". html", 1)
' Read all the contents of the file
Txtall=txtfile.readall
' Display all the contents of a file in the browser
Response.Write Txtall
Txtfile.close
Set txtfile=nothing
End If
%>
<HTML>
<HEAD>
<meta name= "generator" content= "Microsoft Visual Studio 6.0" >
</HEAD>
<BODY>
<P> </P>
</BODY>
</HTML>



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.