In the article publish the system to use the server side to generate the static page the method can reduce the server the burden effectively, especially is very effective to the big traffic website. But since the generated is static page, what is the generation, what is the display, for the article common article is read how many times show it?
After consideration, the following schemes can be used to resolve:
When generating a static page, the ID of an article is generated and stored in the database, so we can make a fuss about the ID of the article when we create the template for the article, and the article template contains the following statements:
<script src= "counter.asp?articleid=<%= #articleId #%>" ></script >
Description
When you generate an article from a template, match the "#articleId #" to the pattern, replacing the ID number of the newly added article.
counter.asp file is an ASP file for implementing a Count
<%
''###################
"' ##### #开始 #########
' By Wang Xiangxu
''###################
Dim articleid,sqlstr,hits
Articleid=int (Trim (Request.QueryString ("ArticleID"))
sqlstr= "Update articles set hits=hits+1 where articleid=" & ArticleID
"To the article click on the number plus 1
Conn.execute (SQLSTR)
"Read the article click Number
Hits=conn.execute ("Select hits from articles where articleid=" & ArticleID) (0)
%>
"Print out the number of clicks on the article
document.write (<%=hits%>)