感觉php的模板功能特别强大,, Asp的模板功能简直就是痛苦,模板写入数据,要修改不方便,,, 或单独分离出来的模板效率太低,, 终于从国外一个代码中获取了灵感... 下面是修改后的惊云的模板,,已经和数据库分离了.. 用这些 [%blue_top%] [%blue_banner%] 标签就可以了... HTML: [%blue_top%] [%blue_banner%] <TABLE class=border cellSpacing=0 cellPadding=0 width=778 border=0> <TBODY> <TR> <TD align=middle> <TABLE class=pageSeparator cellSpacing=0 cellPadding=0 width=766 border=0><TBODY> <TR> <TD bgColor=#ffffff height=4></TD></TR> <TR> <TD align=middle bgColor=#ffffff> <SCRIPT language=javascript src="/ads/banner760.js"></SCRIPT> </TD></TR> <TR> <TR> <TD bgColor=#ffffff height=4></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> <!--Header--> <!--Header--> <SCRIPT language=Javascript> <!-- function urlencode(str) { var ns = (navigator.appName=="Netscape") ? 1 : 0; if (ns) { return escape(str); } var ms = "%25#23 20+2B?3F<3C>3E{7B}7D[5B]5D|7C^5E~7E`60"; var msi = 0; var I,c,rs,ts ; while (msi < ms.length) { c = ms.charAt(msi); rs = ms.substring(++msi, msi +2); msi += 2; I = 0; while (true) { I = str.indexOf(c, i); if (I == -1) break; ts = str.substring(0, i); str = ts + "%" + rs + str.substring(++I, str.length); } } return str; } //--> </SCRIPT> <TABLE class=border cellSpacing=0 cellPadding=0 width=778 border=0> <TBODY> <TR> <TD align=middle> <TABLE class=pageSeparator cellSpacing=0 cellPadding=0 width=766 border=0><TBODY> <TR> <TD align=middle> <TABLE class=pageSeparator cellSpacing=6 cellPadding=0 width=766 border=0> <TBODY> <TR> <TD height=10><SPAN class=location>您的位置:<a href=../index.htm>首页</a>>> 全部软件</SPAN></TD> <TD align=right></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> <TABLE class=border cellSpacing=6 cellPadding=0 width=778 border=0> <TBODY> <TR> <TD class=listcontent vAlign=top width=200> <TABLE class=listcontent cellSpacing=0 cellPadding=6 width="100%" border=0> <TBODY> <TR> <TD class=listTitle> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TBODY> <TR> <TD><STRONG><AC:CATEGORYNAMESHOW />本类下载TOP10</STRONG></TD></TR></TBODY></TABLE></TD></TR> <TR> <TD vAlign=top> <TABLE cellSpacing=0 cellPadding=2 width="100%" border=0> <TBODY> <TR> <TD> [%blue_top10%] </TD></TR> <TR> <TD background=../pic/bg_dot.gif height=1></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE> <TABLE class=border cellSpacing=0 cellPadding=0 width="100%" border=0> <TBODY> <TR> <TD><IMG height=6 src="../pic/spacer.gif" width=6></TD></TR></TBODY></TABLE> <TABLE cellSpacing=0 cellPadding=6 width="100%" border=0> <TBODY> <TR> <TD class=columnTitle> [%blue_left%] </TD> <TD vAlign=top width=560> <TABLE class=border cellSpacing=0 cellPadding=6 width="560" border=0> <TBODY> <TR class=listTitle> <TD noWrap colspan="3" width="548"> <TABLE class=border cellSpacing=0 cellPadding=0 width="100%" border=0 height="11"> <TBODY> <TR> <TD> [%blue_list%] </TD></TR></TBODY></TABLE> </TD> </TR> <TR class=listTitle> <TD noWrap width="174"><STRONG>软件名称</STRONG></TD> <TD noWrap width="275"> <p align="right"><STRONG>更新时间</STRONG></TD> <TD width="75"> <p align="center"><STRONG>软件大小</STRONG></TD></TR> </TBODY></TABLE> <TABLE class=border cellSpacing=0 cellPadding=0 width="100%" border=0 height="11"> <TBODY> <TR> <TD> [%blue_lb%] </TD></TR></TBODY></TABLE> <TABLE class=listtitle cellSpacing=0 cellPadding=1 width="100%" border=0><TBODY> <TR> <TD> <TABLE class=docParameter cellSpacing=0 cellPadding=0 width="100%" border=0> <TBODY> <TR> <TD></TD></TR></TBODY></TABLE> </TD> </TR> </TBODY> </TABLE></TD></TR></TBODY></TABLE> [%blue_foot%] </BODY> </HTML>