Specific code implementation:
1. template file (HTML)
Copy Code code as follows:
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<title>{title}-News Center-ah, jewelry franchise chain </title>
<meta name= "keywords" content= "{Metak}, ah ah jewelry shop, ah Ah franchise shop, ah Ah, ah ah join, ah ah jewelry, ah ah jewelry shop, ah Ah franchise shop, ah Ah chain, how to join the Ah ah"/>
<meta name= "description" content= "{Metad}" (Hong Kong) Oh, dear. Jewelry International Group Co., Ltd. is an operating jewelry, daily necessities, cosmetics, stationery, toys and other companies as a whole, under the processing plants and chain stores two profit centers. Hong Kong Ah Ah jewelry company welcome you love ah Ah jewelry franchise chain. "/>
<link href= "/css/style_new.css" rel= "stylesheet" type= "Text/css"/>
<body>
<div><span class= "Font_white" ></span></div>
<!--top start-->
<div><span class= "Font_white" ></span></div>
<!--top start-->
<div id= "Top" >
<div class= "left" ></div>
<div class= "Right" >
<div class= "Topuser" >
<form class= "Formbox" action= "login_click.asp" "method=" Post "name=" LoginForm "id=" LoginForm "onSubmit=" return Checkform2 () ">
<div style= "LINE-HEIGHT:22PX;HEIGHT:22PX;" > User name:
<input name= "uname" type= "text" class= "bot" id= "uname" size= "" maxlength= ""/> Password:
<input name= "pwd" type= "password" class= "bot" id= "pwd" size= "ten" maxlength= "/><label></label>"
<input type= "Submit" name= "Submit" value= "Landing"/> <input "onclick= ' javascript:window.location= ';" Type=button value= "Register" name=submit2></div>
</form>
</div>
<div class= "Bottomuser" ><a href= "/index.asp" > Home </a> | <a href= "/info_qiyejianjie.asp" > Company Profile </a> | <a href= "/class/" > Product show </a> | <a href= "/news_xinwenzhongxin.asp" > News Center </a> | <a href= "/info_jiamengzhengce.asp" > Distribution Policy </a> | <a href= "/info_kaiyedali.asp" > Opening gift </a> | <a href= "/info_zhuangxiufangan.asp" > Decoration Program </a> | <a href= "/info_xingxiangzhanshi.asp" > Image show </a> | <a href= "/info_jiamengliucheng.asp" > Cooperation Process </a> | <a href= "/info_touziwenda.asp" > Investment FAQ </a> | <a href= "/zaixianliuyan.asp" > Online message </a></div>
</div>
</div>
<!--Top End-->
<!--AD started-->
<div id= "subject01" ><a href= "/info_jiamengzhengce.asp" target= "_blank" ></a></div>
<!--ad End-->
<div class= "Clear" ></div>
<!--Top End-->
<!--AD started-->
<!--ad End-->
<div class= "Clear" ></div>
<!--content started-->
<div id= "Main" >
<!--start on the left-->
<div class= "Left" >
<div class= "Top" style= "Background:url (/images/fenlei_12_07.jpg);" ></div>
<div class= "Middle" >
<ul>
<script language= "javascript" src= ". /.. /class.js "></script>
<li class= "Middle02" ></li>
<li class= "MIDDLE03" > Free hotline:4006-888048<br>
<strong> Continental Headquarters:</strong><br>
Switchboard: 0579-89960888 <br/>
Fax: 0579-85210995 <br>
<strong> Hong Kong Headquarter:</strong><br>
Tel: 00852-36458129 <br>
Fax: 00852-36458092 </li>
<li class= "Middle04" ></li>
</ul>
</div>
<div class= "Bottom" ></div>
<div class= "Leftnews" ></div>
</div>
<!--left End-->
<div class= "Right" >
<div class= "Righttop" ></div>
<div class= "Rightmiddle" >
<ul>
<li class= "><table width=" border= "0" cellpadding= "0" cellspacing= "0" background= "/images/title.jpg" >
<tr>
<TD width= "height=" align= "center" >
<TD width= "596" align= "right" > Current position: <a href= "/index.asp" > Home </a>-News Center </td>
</tr>
</table>
<li class= ">"
</li>
<li class= "style=" text-align:left; >{demo}</li>
</li>
</ul>
</div>
<div class= "Rightbottom" ></div>
</div>
</div>
<!--content End-->
<div class= "Clear" ></div>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/>
<link href= "/css/style_new.css" rel= "stylesheet" type= "Text/css"/>
<div class= "Clear" ></div>
<!--footer started-->
<table cellspacing= "0" cellpadding= "0" width= "948" align= "center" border= "0" >
<tbody>
<tr>
<TD valign= "center" align= "Middle" width= "><a href=" "/info_lianxiwomen.asp" ></a></td>
<TD width= "869" ><span class= "font_space01" ><a href= "/info_qiyejianjie.asp" > About love Yes </a>│< A href= "/info_jiamengzhengce.asp" > affiliate Policy </a> | <a href= "/info_zhuangxiufangan.asp" > Decoration Program </a> | <a href= "/info_jiamengyoushi.asp" > Join Advantage </a> | <a href= "/class/" > Products </a>│<a href= "/zaixianliuyan.asp" > Online message </a>│<a href= "/info_ Lianxiwomen.asp "> Contact us </a>│<a href=" sitemap.html "target=" _blank "> Site map </a></span>< br/>
Address: Yiwu Economic development Zone, Zhejiang Province, no. 123th Shek Fish Road, 8 (next to thick Jiang Middle school) Mainland Tel: 0579-89960888 free hotline: 4006-888048 <br/>
</td>
</tr>
</tbody>
</table>
<!--footer End-->
<span style= "Visibility:hidden;" ><a href= "http://www.51aiyaya.com" target= "_blank" ><strong> Oh yes </strong></a>
<a href= "http://www.51aiyaya.com" target= "_blank" > Oops join </a>
<a href= "http://www.51aiyaya.com" target= "_blank" > Oops jewelry </a> <script src= "http://s23.cnzz.com/ stat.php?id=1117055&web_id=1117055 "language=" JavaScript "charset=" gb2312 "></script></span>
</body>
2. Processed documents (ASP)
Copy Code code as follows:
<!--#include file= "conn.asp"-->
<%Server.ScriptTimeOut=99999999%>
<%
Dim action,id,news
Layout= "News"
Id=request. QueryString ("id")
Action=request. QueryString ("Action")
Select Case Action
Case "Add"
%>
<%
' Generate HTML All
Case "Htmlall"
Set Rs=server. CreateObject ("Adodb.recordset")
SQL = "SELECT ID from News order by id"
Rs.Open sql,conn,1,1
Do as not rs.eof
Fsofile "News", RS ("id")
Response.Write "<div style= ' color: #003333; ' align= ' center ' >" &RS ("id") & "News generated HTML success!</div>"
Rs.movenext
Loop
Rs.close
Response.Write "<div style= ' color: #FF0000; ' align= ' center ' > all news generate HTML Success!</div></br>"
End Select
%>
<%
' Generate Chinese HTML
Function Fsofile (Layout,id)
Dim Fso,filepath,fsof,fsoh,fsors,createfilepath
Fsocreatedir ". \news\ "& ID &" "
Createfilepath = ".. \news\ "& ID &" ' HTML folder
Filepath=server.mappath (Createfilepath) & "\index.html" defines the generation of HTML file names
Set fso=server.createobject ("Scripting.FileSystemObject")
Set Fsoh=fso.opentextfile (Server.MapPath ("...). \templates\news_show.html "), 1,true) ' Read template
Content = Fsoh.readall
Set fsors = Conn.execute ("SELECT * from news where id=" &id)
Title=fsors ("title")
Demo=fsors ("demo")
Content = Replace (content, "{ID}", fsors ("id"))
Content = Replace (content, "{title}", Fsors ("title"))
Content = Replace (content, "{demo}", Fsors ("demo"))
Content = Replace (content, "{webname}", WebName)
Content = Replace (content, "{ICP}", ICP)
Content = Replace (content, "{Dianhua}", Dianhua)
Content = Replace (content, "{Dizhi}", Dizhi)
Content = Replace (content, "{QQ}", QQ)
Content = Replace (content, "{Alibaba}", Alibaba)
Content = Replace (content, "{Tongji}", Tongji)
Fsors.close
Set fsors=nothing
Set stm = Server.CreateObject ("ADODB.") Stream ")
Stm. Charset = "gb2312" defines encoding
Stm. Open
Stm. WRITETEXT content
Stm. SaveToFile FilePath, 2
Set stm = Nothing
End Function
%>
<%
function Fsocreatedir (localpath)
Dim patharr,path_level,i,pathtmp,cpath,createdir,fileobject
On Error Resume Next
LocalPath = Server.MapPath (LocalPath)
LocalPath = replace (LocalPath, "\", "/")
Set fileobject = Server.CreateObject ("Scripting.FileSystemObject")
Patharr = Split (LocalPath, "/")
Path_level = UBound (Patharr)
For i = 0 to Path_level
If i=0 then pathtmp = Patharr (0) & "/" Else Pathtmp = pathtmp & Patharr (i) & "/"
CPath = Left (Pathtmp,len (pathtmp)-1)
If not fileobject.folderexists (CPath) then Fileobject.createfolder (CPath)
Next
Set FileObject = Nothing
If Err.number<>0 Then
Createdir = False
Err. Clear
Else
Createdir = True
End If
End Function
%>
3. Add generate static news links in the background
Copy Code code as follows:
<TD height=20 align= "center" ><a href=. /admin_product/saveaddnews.asp?action=htmlall "target=" Ggdlab > Generate news static </a></TD>
From my blog.
http://blog.csdn.net/lingfeng179