Two days ago, I made an article publishing a program for a website (www.cfsoft.com.cn). In order to make the website more likely to be searched for the website, the content is a static page.
1. XXFB table structure is as follows:
Type type, used in my website to distinguish several columns, I have a technology and a news.
Pagetital page title
Keywords page keyword
Description in the description page Mata
DOCTITLE Article Title
doctext article content
THEDATE release time
OrderID Sorting Code
Is the comDend labeling as a recommended article
Second, each type defines a list of list_ plus types of directory template page, a TEMP_ plus type name articles template page.
3. The following is a static page generating main program:
The following is the reference content: If trim (request (flag)) = Build then '--- Generate directory ------ SQL = SELECT DISTIT TYPE FROM XXFB Set objrs = const.execute (SQL) While Not Objrs.eof url = siteurl &/admin/list_ & trim (objrs (type)) &. ASP set http = server.createObject (msxml2.xmlhttp) Http.open get, url, false Http.send () set objstream = Server.createObject (Adodb.Stream) objstream.type = 1 objstream.open objstream.write http.responsebody Objstream.SavetoFile Server.mappath (/& Trim (Objrs (Type)) &/& Trim (Objrs (Type)) &. HTM, 2 objstream.close Set objstream = Nothing objrs.movenext Wend Set objrs = nothing SQL = SELECT * From XXFB Order by thedate Desc Set objrs = const.execute (SQL) While Not Objrs.eof URL = SITEURL &/Admin/TEMP_ & Trim (Objrs (Type)) &. ASP? ID = & Trim (objrs (ID)) set http = server.createObject (msxml2.xmlhttp) Http.open get, url, false Http.send () set objstream = Server.createObject (Adodb.Stream) objstream.type = 1 objstream.open objstream.write http.responsebody Objstream.Savetofile Server.mappath (/& Trim (Objrs (Type)) &/& Trim (objrs (ID) &. htm), 2 objstream.close Set objstream = Nothing objrs.movenext wend Response.Write generates a static webpage success! End if |