Recommended: How to use ASP to remove three highest scores and three lowest scores Question: How to use asp to remove the three highest scores and three lowest scores? Solution: 1. Sort the entire array and delete the three maximum values and three minimum values at both ends (proposed by another netizen!) 2. Select the three largest numbers and three smallest numbers, and
Everyone knows that HTML static web pages are more likely to be indexed by search engines. Dynamically generate HTML web pages can also increase the number of web pages on the website, and search engines may also include more. What is the point of improving the quality of the web pages? ? I think everyone knows it too.
For this, I decided to change the previous methods of website construction and web design. After multiple research and thinking, for the dynamic generation methods of multiple web pages, I prefer to use tag replacement to generate web pages.
Label replacement method: This is the definition I personally understand. I don’t know what others call it, haha!
The tag replacement method is to put the set tags into the designed web template, and then replace them with the things you need to display. like
Template file 1
We save this template in the database table temptable
<html>
<head>
<title>{$SiteName} </title>
</head>
<body>
{$Arc_List$}
</body>
<html>
In the above template, I have put two tags {$SiteName} website name and {$Arc_List$} article list, and then look at the following code
<%
dim rs,SiteName,Arc_List,fso,myFile,FilePath,html
SiteName=My first dynamically generated HTML page
FilePath = Server.MapPath(/html/index.html)
set rs=server.createobject(adodb.recordset)
rs.openselect [temp] from temptable,conn,1,1
html = rs(temp) 'Read web page template
rs.close
html = replace(html, {$SiteName} , SiteName) 'Replace {$SiteName} tag with a custom SiteName
html = html & replace(html, {$Arc_List$} , get_ArcList()) 'Replace the {$Arc_List$} tag with the custom get_ArcList() function
set rs=nothing
conn.close
set conn=nothing
set fso=CreateObject(***ing.FileSystemObject) 'Create a file system object
Set MyFile = fso.CreateTextFile(FilePath,True) 'Create file
MyFile.WriteLine(html) 'Write htm code to file
MyFile.close 'Close File
Set MyFile = nothing 'Release the file object
set fso = nothing 'Release the system file object
response.write <*** language='java***'>window.alert('File generation was successful');</***>
response.end()
Function get_ArcList()
dim str,str1
str1=
str = <ul>{list}</ul>
rs.openselect Title,url from Arc
while not rs.eof
str1 = str1 & <li><a href=&rs(url)&>&rs(Title)&</a></li>
rs.movenext
wend
rs.close
str = replace(str, {list}, Str1)
get_ArcList = str
%>
End Function
Is the above method very simple? Now many CMSs use this method to generate static web pages. This method is more flexible. As long as you design your system carefully, you can build a website in the future and design a template. Now. . . Haha, Yu is now working in a website construction company. He will write something casually when he has time. Yu’s QQ: 645556964. Welcome to be friends to discuss and communicate together. Haha
Share: Use ASP to realize the function of online article translation Sometimes I want to provide multi-language support for our web pages. It is too troublesome to use one web page for one language. Fortunately, Google provides language tool functions. The following describes how to use it to convert web pages between multiple languages. . lan.htm