<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>无风的港湾 &#187; 模板</title>
	<atom:link href="http://www.5bay.cn/tag/%E6%A8%A1%E6%9D%BF/feed" rel="self" type="application/rss+xml" />
	<link>http://www.5bay.cn</link>
	<description>让你我停泊~</description>
	<lastBuildDate>Fri, 16 Dec 2011 09:18:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>防止网卡被禁用的具体配置方法</title>
		<link>http://www.5bay.cn/server-building/eeeeeeee-2.html</link>
		<comments>http://www.5bay.cn/server-building/eeeeeeee-2.html#comments</comments>
		<pubDate>Wed, 28 Jul 2010 01:58:21 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[服务器构建&安全]]></category>
		<category><![CDATA[属性]]></category>
		<category><![CDATA[方法]]></category>
		<category><![CDATA[模板]]></category>
		<category><![CDATA[策略]]></category>
		<category><![CDATA[组件]]></category>
		<category><![CDATA[连接]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=523</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/server-building/eeeeeeee-2.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>防止网卡被意外禁用，这个对大家可能没有多大的用途，但如果你有服务器托管在外面，那可就有用了，如果你那天不小心点到了“禁用”，呵呵，那后果我就不用说了吧，你的服务器马上就跟你说拜拜了，而且必须进入机房去重新启用网卡才可以（我就碰到了这样的倒霉事啊）。 闲话不多说，下面说重点： 实现的方法，用组策略来实现。 　　步骤： 　　1、运行——》gpedit.msc 　　2、导航至：用户配置——》管理模板——》网络——》网络连接 　　3.1、找到“禁止启用/禁用 LAN 连接的组件”，设置为“已启用” 　　3.2、找到“启用/禁用 LAN 连接的能力”，设置为“已禁用” 　　3.3、找到“为管理员启用 Windows 2000 网络连接设置”，设置为“已启用” 　　4、运行——》gpupdate /force 　　你现在检查一下本地连接的属性，“禁用”按钮已经变成灰色的不可用状态，这下你再也不用担心意外点中，让你的服务器跟你说拜拜了。 相关博文2011年06月29日 -- Android在线开发工具 App Inventor (0)2010年07月26日 -- Ajax的工作原理 (1)2010年05月23日 -- Rsync详解 (0)2011年06月29日 -- 网上整理的android权限大全 (0)2010年07月28日 -- ASP防注入新方式，希望对大家是有用的 (0)2010年07月28日 -- 无需输入密码登陆3389 (0)2010年07月26日 -- php的文档句法(heredoc)]]></description>
			<content:encoded><![CDATA[<p>防止网卡被意外禁用，这个对大家可能没有多大的用途，但如果你有服务器托管在外面，那可就有用了，如果你那天不小心点到了“禁用”，呵呵，那后果我就不用说了吧，你的服务器马上就跟你说拜拜了，而且必须进入机房去重新启用网卡才可以（我就碰到了这样的倒霉事啊）。</p>
<p>闲话不多说，下面说重点：</p>
<p>实现的方法，用组策略来实现。</p>
<p>　　步骤：</p>
<p>　　1、运行——》gpedit.msc</p>
<p>　　2、导航至：用户配置——》管理模板——》网络——》网络连接</p>
<p>　　3.1、找到“禁止启用/禁用 LAN 连接的组件”，设置为“已启用”</p>
<p>　　3.2、找到“启用/禁用 LAN 连接的能力”，设置为“已禁用”</p>
<p>　　3.3、找到“为管理员启用 Windows 2000 网络连接设置”，设置为“已启用”</p>
<p>　　4、运行——》gpupdate /force</p>
<p>　　你现在检查一下本地连接的属性，“禁用”按钮已经变成灰色的不可用状态，这下你再也不用担心意外点中，让你的服务器跟你说拜拜了。</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2011年06月29日 -- <a href="http://www.5bay.cn/android%e7%ac%94%e8%ae%b0/androidzaixiankaifagongjuappinventor.html" title="Android在线开发工具 App Inventor">Android在线开发工具 App Inventor</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/rsyncxiangjie.html" title="Rsync详解">Rsync详解</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/android%e7%ac%94%e8%ae%b0/wangshangzhenglideandroidquanxiandaquan.html" title="网上整理的android权限大全">网上整理的android权限大全</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeeeee389.html" title="无需输入密码登陆3389">无需输入密码登陆3389</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeefangeredoc.html" title="php的文档句法(heredoc)<<<和PHP字符串操作">php的文档句法(heredoc)<<<和PHP字符串操作</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeeeeeeeehuai.html" title="PHP对文本数据库的基本操作方法">PHP对文本数据库的基本操作方法</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpzhongdememcachehanshukumemcachefunctions.html" title="PHP中的Memcache函数库（Memcache Functions）">PHP中的Memcache函数库（Memcache Functions）</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/gaoxingnengwangzhanjianshezhinandushubiji.html" title="《高性能网站建设指南》读书笔记">《高性能网站建设指南》读书笔记</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/%E5%B1%9E%E6%80%A7" title="属性" rel="tag">属性</a>, <a href="http://www.5bay.cn/tag/%E6%96%B9%E6%B3%95" title="方法" rel="tag">方法</a>, <a href="http://www.5bay.cn/category/server-building" title="服务器构建&amp;安全" rel="tag">服务器构建&amp;安全</a>, <a href="http://www.5bay.cn/tag/%E6%A8%A1%E6%9D%BF" title="模板" rel="tag">模板</a>, <a href="http://www.5bay.cn/tag/%E7%AD%96%E7%95%A5" title="策略" rel="tag">策略</a>, <a href="http://www.5bay.cn/tag/%E7%BB%84%E4%BB%B6" title="组件" rel="tag">组件</a>, <a href="http://www.5bay.cn/tag/%E8%BF%9E%E6%8E%A5" title="连接" rel="tag">连接</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/server-building/eeeeeeee-2.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS 中的太极拳口诀</title>
		<link>http://www.5bay.cn/me/csseeeeyao.html</link>
		<comments>http://www.5bay.cn/me/csseeeeyao.html#comments</comments>
		<pubDate>Thu, 22 Jul 2010 14:42:52 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[邪人邪语]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[人]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[兼容]]></category>
		<category><![CDATA[图片]]></category>
		<category><![CDATA[容器]]></category>
		<category><![CDATA[模板]]></category>
		<category><![CDATA[网站]]></category>
		<category><![CDATA[设计]]></category>
		<category><![CDATA[诫]]></category>
		<category><![CDATA[链接]]></category>

		<guid isPermaLink="false">http://www.5bay.cn/?p=434</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/me/csseeeeyao.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>在做网站过程中，常常要修改网站模板，而模板受css控制。如果在用CSS设计布局时遇到BUG，请认真阅读以下内容，非常容易记忆的，不知道哪位高人把CSS BUG编成了*****了！看看好不好记住呢？ 一、IE边框若显若无，须注意，定是高度设置已忘记； 二、浮动产生有缘故，若要父层包含住，紧跟浮动要清除，容器自然显其中； 三、三像素文本慢移不必慌，高度设置帮你忙； 四、兼容各个浏览须注意，默认设置行高可能是*****； 五、独立清除浮动须铭记，行高设无，高设零，设计效果兼浏览； 六、学布局须思路，路随布局原理自然直，轻松驾驭html，流水布局少hack，代码清爽，兼容好，友好引擎喜欢迎。 七、所有标签皆有源，只是默认各不同，span是无极，无极生两仪&#8212;内联和块级，img较特殊，但也遵法理，其他只是改造各不同，一个*号全归原，层叠样式理须多练习，万物皆规律。 八、图片链接排版须小心，图片链接文字链接若对齐，padding和vertical-align:middle要设定，虽差微细倒无妨。 九、IE浮动双边距，请用display：inline拘。 十、列表横向排版，列表代码须紧靠，空隙自消须铭记。 相关博文2010年07月26日 -- 使用Ajax时的十个常犯的错误 (0)2010年07月26日 -- ajax的缺点 (0)2010年07月26日 -- Ajax的工作原理 (1)2010年07月26日 -- 基于JSON的高级AJAX开发技术 (0)2010年05月23日 -- nginx的rewrite规则 (1)2010年07月26日 -- AJAX应用程序开发七宗罪 (0)2010年07月26日 -- PHP安全之数据过滤 (0)2010年05月23日 -- 图片轮换类，IE7、OP、FF、Chrome测试通过 (2)2010年05月23日 -- 《高性能网站建设指南》读书笔记 (0)2010年07月28日 -- ASP防注入新方式，希望对大家是有用的 (0)2010年07月28日 -- Webshell下破解计算机管理员密码 (0)2010年07月28日 -- 帝国备份王(Empirebak)拿webshell (0)2010年07月26日 -- 最令PHP初学者头痛的十四个问题 (0)2010年07月26日 -- 深入探讨PHP中的内存管理问题 (0)2010年07月26日 [...]]]></description>
			<content:encoded><![CDATA[<p>在做网站过程中，常常要修改网站模板，而模板受css控制。如果在用CSS设计布局时遇到BUG，请认真阅读以下内容，非常容易记忆的，不知道哪位高人把CSS BUG编成了*****了！看看好不好记住呢？<br />
一、IE边框若显若无，须注意，定是高度设置已忘记；<br />
二、浮动产生有缘故，若要父层包含住，紧跟浮动要清除，容器自然显其中；<br />
三、三像素文本慢移不必慌，高度设置帮你忙；<br />
四、兼容各个浏览须注意，默认设置行高可能是*****；<br />
五、独立清除浮动须铭记，行高设无，高设零，设计效果兼浏览；<br />
六、学布局须思路，路随布局原理自然直，轻松驾驭html，流水布局少hack，代码清爽，兼容好，友好引擎喜欢迎。<br />
七、所有标签皆有源，只是默认各不同，span是无极，无极生两仪&mdash;内联和块级，img较特殊，但也遵法理，其他只是改造各不同，一个*号全归原，层叠样式理须多练习，万物皆规律。<br />
八、图片链接排版须小心，图片链接文字链接若对齐，padding和vertical-align:middle要设定，虽差微细倒无妨。<br />
九、IE浮动双边距，请用display：inline拘。<br />
十、列表横向排版，列表代码须紧靠，空隙自消须铭记。</p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/nginxderewriteguize.html" title="nginx的rewrite规则">nginx的rewrite规则</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeaoe.html" title="AJAX应用程序开发七宗罪">AJAX应用程序开发七宗罪</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/tupianlunhuanleiie7opffchromeceshitongguo.html" title="图片轮换类，IE7、OP、FF、Chrome测试通过">图片轮换类，IE7、OP、FF、Chrome测试通过</a> (2)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/gaoxingnengwangzhanjianshezhinandushubiji.html" title="《高性能网站建设指南》读书笔记">《高性能网站建设指南》读书笔记</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/webshelleechueeee.html" title="Webshell下破解计算机管理员密码">Webshell下破解计算机管理员密码</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aoeempirebakeebshell.html" title="帝国备份王(Empirebak)拿webshell">帝国备份王(Empirebak)拿webshell</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/css" title="css" rel="tag">css</a>, <a href="http://www.5bay.cn/tag/html" title="html" rel="tag">html</a>, <a href="http://www.5bay.cn/tag/ie" title="ie" rel="tag">ie</a>, <a href="http://www.5bay.cn/tag/%E4%BA%BA" title="人" rel="tag">人</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E5%85%BC%E5%AE%B9" title="兼容" rel="tag">兼容</a>, <a href="http://www.5bay.cn/tag/%E5%9B%BE%E7%89%87" title="图片" rel="tag">图片</a>, <a href="http://www.5bay.cn/tag/%E5%AE%B9%E5%99%A8" title="容器" rel="tag">容器</a>, <a href="http://www.5bay.cn/tag/%E6%A8%A1%E6%9D%BF" title="模板" rel="tag">模板</a>, <a href="http://www.5bay.cn/tag/%E7%BD%91%E7%AB%99" title="网站" rel="tag">网站</a>, <a href="http://www.5bay.cn/tag/%E8%AE%BE%E8%AE%A1" title="设计" rel="tag">设计</a>, <a href="http://www.5bay.cn/tag/e" title="诫" rel="tag">诫</a>, <a href="http://www.5bay.cn/category/me" title="邪人邪语" rel="tag">邪人邪语</a>, <a href="http://www.5bay.cn/tag/%E9%93%BE%E6%8E%A5" title="链接" rel="tag">链接</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/me/csseeeeyao.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>phpok中秋节模板出炉啦～</title>
		<link>http://www.5bay.cn/me/phpok%e4%b8%ad%e7%a7%8b%e8%8a%82%e6%a8%a1%e6%9d%bf%e5%87%ba%e7%82%89%e5%95%a6%ef%bd%9e.html</link>
		<comments>http://www.5bay.cn/me/phpok%e4%b8%ad%e7%a7%8b%e8%8a%82%e6%a8%a1%e6%9d%bf%e5%87%ba%e7%82%89%e5%95%a6%ef%bd%9e.html#comments</comments>
		<pubDate>Fri, 22 Aug 2008 13:44:29 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[邪人邪语]]></category>
		<category><![CDATA[phpok]]></category>
		<category><![CDATA[中秋节]]></category>
		<category><![CDATA[模板]]></category>

		<guid isPermaLink="false">?p=280</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/me/phpok%e4%b8%ad%e7%a7%8b%e8%8a%82%e6%a8%a1%e6%9d%bf%e5%87%ba%e7%82%89%e5%95%a6%ef%bd%9e.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>作者： 江小邪      [主页] 演示： 点击查看 适用版本： 2.2 添加日期： 2008-8-22 05:45 简介： phpok中秋节模板，移植于bo-blog的中秋节模板。模板在IE6、IE7 &#38; FireFox下测试通过。 下载地址：http://5bay.cn/mydoc/phpok/Mid-Autumn.rar 相关博文2008年07月31日 -- 发个phpok奥运模板 (2)2010年07月28日 -- 防止网卡被禁用的具体配置方法 (0)2010年07月22日 -- CSS 中的太极拳口诀 (0)2008年11月17日 -- URLSEO patchs for PHPOK3.0 simple (0)2008年10月14日 -- URLSEO patchs for PHPOK 2.2 (3)2006年12月22日 -- 使用模板实现ASP代码与页面分离 (0)2006年12月11日 -- PHP-Web 应用程序开发：使用模板 (0)2006年12月9日 -- 创造世界上最简单的 PHP 开发模式 (0) 标签Tags：phpok, 中秋节, 模板, 邪人邪语]]></description>
			<content:encoded><![CDATA[<p>作者： 江小邪      <a href="http://www.5bay.cn" target="_blank">[主页]</a><br />
演示： <a href="http://5bay.cn/phpok/home.php?template=Mid-Autumn" target="_blank">点击查看</a><br />
适用版本： 2.2<br />
添加日期： 2008-8-22 05:45<br />
简介： phpok中秋节模板，移植于bo-blog的中秋节模板。模板在IE6、<a href="http://www.5bay.cn/tag/ie" class="st_tag internal_tag" rel="tag" title="标签 ie 下的日志">IE</a>7 &amp; FireFox下测试通过。<br />
下载地址：<a href="http://5bay.cn/mydoc/phpok/Mid-Autumn.rar">http://5bay.cn/mydoc/phpok/Mid-Autumn.rar</a></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2008年07月31日 -- <a href="http://www.5bay.cn/me/%e5%8f%91%e4%b8%aaphpok%e5%a5%a5%e8%bf%90%e6%a8%a1%e6%9d%bf.html" title="发个phpok奥运模板">发个phpok奥运模板</a> (2)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeeeeeee-2.html" title="防止网卡被禁用的具体配置方法">防止网卡被禁用的具体配置方法</a> (0)</li><li>2010年07月22日 -- <a href="http://www.5bay.cn/me/csseeeeyao.html" title="CSS 中的太极拳口诀">CSS 中的太极拳口诀</a> (0)</li><li>2008年11月17日 -- <a href="http://www.5bay.cn/me/urlseopatchsforphpok30simple.html" title="URLSEO patchs for PHPOK3.0 simple">URLSEO patchs for PHPOK3.0 simple</a> (0)</li><li>2008年10月14日 -- <a href="http://www.5bay.cn/me/urlseopatchsforphpok22.html" title="URLSEO patchs for PHPOK 2.2">URLSEO patchs for PHPOK 2.2</a> (3)</li><li>2006年12月22日 -- <a href="http://www.5bay.cn/network-programming/asp/%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF%E5%AE%9E%E7%8E%B0asp%E4%BB%A3%E7%A0%81%E4%B8%8E%E9%A1%B5%E9%9D%A2%E5%88%86%E7%A6%BB.html" title="使用模板实现ASP代码与页面分离">使用模板实现ASP代码与页面分离</a> (0)</li><li>2006年12月11日 -- <a href="http://www.5bay.cn/network-programming/php/phpweb%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E5%BC%80%E5%8F%91%EF%BC%9A%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF.html" title="PHP-Web 应用程序开发：使用模板">PHP-Web 应用程序开发：使用模板</a> (0)</li><li>2006年12月9日 -- <a href="http://www.5bay.cn/network-programming/php/%E5%88%9B%E9%80%A0%E4%B8%96%E7%95%8C%E4%B8%8A%E6%9C%80%E7%AE%80%E5%8D%95%E7%9A%84php%E5%BC%80%E5%8F%91%E6%A8%A1%E5%BC%8F.html" title="创造世界上最简单的 PHP 开发模式">创造世界上最简单的 PHP 开发模式</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/phpok" title="phpok" rel="tag">phpok</a>, <a href="http://www.5bay.cn/tag/%E4%B8%AD%E7%A7%8B%E8%8A%82" title="中秋节" rel="tag">中秋节</a>, <a href="http://www.5bay.cn/tag/%E6%A8%A1%E6%9D%BF" title="模板" rel="tag">模板</a>, <a href="http://www.5bay.cn/category/me" title="邪人邪语" rel="tag">邪人邪语</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/me/phpok%e4%b8%ad%e7%a7%8b%e8%8a%82%e6%a8%a1%e6%9d%bf%e5%87%ba%e7%82%89%e5%95%a6%ef%bd%9e.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>发个phpok奥运模板</title>
		<link>http://www.5bay.cn/me/%e5%8f%91%e4%b8%aaphpok%e5%a5%a5%e8%bf%90%e6%a8%a1%e6%9d%bf.html</link>
		<comments>http://www.5bay.cn/me/%e5%8f%91%e4%b8%aaphpok%e5%a5%a5%e8%bf%90%e6%a8%a1%e6%9d%bf.html#comments</comments>
		<pubDate>Thu, 31 Jul 2008 23:11:07 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[邪人邪语]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[phpok]]></category>
		<category><![CDATA[北京]]></category>
		<category><![CDATA[奥运]]></category>
		<category><![CDATA[模板]]></category>

		<guid isPermaLink="false">?p=279</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/me/%e5%8f%91%e4%b8%aaphpok%e5%a5%a5%e8%bf%90%e6%a8%a1%e6%9d%bf.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>作者： 江小邪      [主页] 演示： 点击查看 适用版本： 2.2 添加日期： 2008-7-31 14:53 简介： 北京奥运的2008模板，在phpok的默认模板基础上修改。 下载地址：http://5bay.cn/mydoc/phpok/2008beijing.rar 相关博文2008年11月17日 -- URLSEO patchs for PHPOK3.0 simple (0)2008年08月22日 -- phpok中秋节模板出炉啦～ (2)2010年07月28日 -- 防止网卡被禁用的具体配置方法 (0)2010年07月28日 -- Webshell下破解计算机管理员密码 (0)2010年07月28日 -- 帝国备份王(Empirebak)拿webshell (0)2010年07月22日 -- CSS 中的太极拳口诀 (0)2010年05月23日 -- 各种浏览器的userAgent (0)2008年10月14日 -- URLSEO patchs for PHPOK 2.2 (3)2006年12月22日 -- 使用模板实现ASP代码与页面分离 (0)2006年12月11日 -- PHP-Web 应用程序开发：使用模板 (0)2006年12月9日 -- 创造世界上最简单的 [...]]]></description>
			<content:encoded><![CDATA[<p>作者： 江小邪      <a href="http://www.5bay.cn" target="_blank">[主页]</a><br />
演示： <a href="http://5bay.cn/phpok/home.php?template=2008beijing" target="_blank">点击查看</a><br />
适用版本： 2.2<br />
添加日期： 2008-7-31 14:53<br />
简介： 北京奥运的2008<a href="http://www.5bay.cn/tag/%E6%A8%A1%E6%9D%BF" class="st_tag internal_tag" rel="tag" title="标签 模板 下的日志">模板</a>，在phpok的默认模板基础上修改。<br />
下载地址：<a href="http://5bay.cn/mydoc/phpok/2008beijing.rar">http://5bay.cn/mydoc/phpok/2008beijing.rar</a></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2008年11月17日 -- <a href="http://www.5bay.cn/me/urlseopatchsforphpok30simple.html" title="URLSEO patchs for PHPOK3.0 simple">URLSEO patchs for PHPOK3.0 simple</a> (0)</li><li>2008年08月22日 -- <a href="http://www.5bay.cn/me/phpok%e4%b8%ad%e7%a7%8b%e8%8a%82%e6%a8%a1%e6%9d%bf%e5%87%ba%e7%82%89%e5%95%a6%ef%bd%9e.html" title="phpok中秋节模板出炉啦～">phpok中秋节模板出炉啦～</a> (2)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeeeeeee-2.html" title="防止网卡被禁用的具体配置方法">防止网卡被禁用的具体配置方法</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/webshelleechueeee.html" title="Webshell下破解计算机管理员密码">Webshell下破解计算机管理员密码</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aoeempirebakeebshell.html" title="帝国备份王(Empirebak)拿webshell">帝国备份王(Empirebak)拿webshell</a> (0)</li><li>2010年07月22日 -- <a href="http://www.5bay.cn/me/csseeeeyao.html" title="CSS 中的太极拳口诀">CSS 中的太极拳口诀</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/gezhonglanqideuseragent.html" title="各种浏览器的userAgent">各种浏览器的userAgent</a> (0)</li><li>2008年10月14日 -- <a href="http://www.5bay.cn/me/urlseopatchsforphpok22.html" title="URLSEO patchs for PHPOK 2.2">URLSEO patchs for PHPOK 2.2</a> (3)</li><li>2006年12月22日 -- <a href="http://www.5bay.cn/network-programming/asp/%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF%E5%AE%9E%E7%8E%B0asp%E4%BB%A3%E7%A0%81%E4%B8%8E%E9%A1%B5%E9%9D%A2%E5%88%86%E7%A6%BB.html" title="使用模板实现ASP代码与页面分离">使用模板实现ASP代码与页面分离</a> (0)</li><li>2006年12月11日 -- <a href="http://www.5bay.cn/network-programming/php/phpweb%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E5%BC%80%E5%8F%91%EF%BC%9A%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF.html" title="PHP-Web 应用程序开发：使用模板">PHP-Web 应用程序开发：使用模板</a> (0)</li><li>2006年12月9日 -- <a href="http://www.5bay.cn/network-programming/php/%E5%88%9B%E9%80%A0%E4%B8%96%E7%95%8C%E4%B8%8A%E6%9C%80%E7%AE%80%E5%8D%95%E7%9A%84php%E5%BC%80%E5%8F%91%E6%A8%A1%E5%BC%8F.html" title="创造世界上最简单的 PHP 开发模式">创造世界上最简单的 PHP 开发模式</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/tag/2008" title="2008" rel="tag">2008</a>, <a href="http://www.5bay.cn/tag/phpok" title="phpok" rel="tag">phpok</a>, <a href="http://www.5bay.cn/tag/%e5%8c%97%e4%ba%ac" title="北京" rel="tag">北京</a>, <a href="http://www.5bay.cn/tag/%e5%a5%a5%e8%bf%90" title="奥运" rel="tag">奥运</a>, <a href="http://www.5bay.cn/tag/%E6%A8%A1%E6%9D%BF" title="模板" rel="tag">模板</a>, <a href="http://www.5bay.cn/category/me" title="邪人邪语" rel="tag">邪人邪语</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/me/%e5%8f%91%e4%b8%aaphpok%e5%a5%a5%e8%bf%90%e6%a8%a1%e6%9d%bf.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>使用模板实现ASP代码与页面分离</title>
		<link>http://www.5bay.cn/network-programming/asp/%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF%E5%AE%9E%E7%8E%B0asp%E4%BB%A3%E7%A0%81%E4%B8%8E%E9%A1%B5%E9%9D%A2%E5%88%86%E7%A6%BB.html</link>
		<comments>http://www.5bay.cn/network-programming/asp/%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF%E5%AE%9E%E7%8E%B0asp%E4%BB%A3%E7%A0%81%E4%B8%8E%E9%A1%B5%E9%9D%A2%E5%88%86%E7%A6%BB.html#comments</comments>
		<pubDate>Fri, 22 Dec 2006 01:47:23 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[ASP]]></category>
		<category><![CDATA[代码]]></category>
		<category><![CDATA[分离]]></category>
		<category><![CDATA[模板]]></category>
		<category><![CDATA[页面]]></category>

		<guid isPermaLink="false">?p=158</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/asp/%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF%E5%AE%9E%E7%8E%B0asp%E4%BB%A3%E7%A0%81%E4%B8%8E%E9%A1%B5%E9%9D%A2%E5%88%86%E7%A6%BB.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>　　每个进行过较大型的ASP-Web应用程序设计的开发人员大概都有如下的经历：ASP代码与页面HTML混淆难分，业务逻辑与显示方式绞合，使得代码难以理解、难以修改；程序编写必须在美工之后，成为项目瓶颈；整合的程序代码和HTML和web应用不容易将数据的处理和数据的显示分开，但在多人合作的情况下，如果无法将数据和显示分开，将大大影响开发的效率，专业分工的发挥。　　其它的脚本语言，如JSP、PHP都有自己的解决方案，ASP的后一代产品ASP.NET也实现了代码与页面，似乎直接过渡到ASP是不错的选择。但是总有这样或那样的原因让我们不能或暂时不能放弃ASP直奔.NET大营。从公司角度来看，转换语言是一笔不少的投资，包括雇佣熟手.NET程序员、培训原有程序员、开发工具的转型、开发风格的转型、界面风格转变、接口风格、软件架构、文档、开发流程等等；这还意味着原有的代码必须在新语言环境里重写以实现最佳的效果和稳定性；同时将直接影响这段时间内项目的进度，更有可能导致个别程序员出走。由此看来在您决定转换语言之前，在原基础上寻求一种解决方案，才是最好的选择。　　PHP通过模板实现代码与页面，可供选择的有FastTemplate、PHPLIB、Smarty等多种，其中PHPLIB的影响最大、使用最多。既然如此，我们直接把它搬到ASP来，对于同时使用PHP和ASP的公司还有很有好处：一、美工处理页面时，不管将要套用PHP还是ASP，处理方式是一样，无须经过培训；二、程序员编写代码时，两种语言间的思路接近或一致，相同功能在两种语言实现时，只需拷贝过来略作修改即可，保证了工作效率和项目进度。 1、模板类的设计　　实现代码封装成为模板类，即是为了与PHPLIB兼容，也使得代码方便管理与扩展。　　模板类要实现的目标为：从模板文件中读入显示的HTML代码，将这些显示代码中需要动态数据的地方替换为ASP程序运算所得出的数据，然后按照一定的顺序输出。其中，替换的部分可以自由的设定。因此它必须完成如下任务： &#160; &#160;·从模板文件中读取显示用的HTML代码。 &#160; &#160;·将模板文件和实际生成的数据结合，生成输出的结果。 &#160; &#160;·允许同时处理多个模板。 &#160; &#160;·允许模板的嵌套。 &#160; &#160;·允许对模板中的某个单独的部分进行处理。实现方法： &#160; &#160;采用FSO读取模板文件 &#160; &#160;采用正则替换实现模板文件和数据的结合 &#160; &#160;处理多个模板用数组存储来实现。 &#160; &#160;模板的嵌套的实现主要的想法是：将模板和输出（任何中间的分析结果）一视同仁，都可拿来做替换，即可实现。 &#160; &#160;单独部分的处理的通过在模板文件中设定标注，然后在正则替换中结合标注来控制，实现部分替换。2、模板类的实现　　给出具体代码之前，先把主要函数列出，用过PHPLIB的朋友应该对此很熟悉了：　　1）Public Sub set_root(ByVal value)　设定模板默认目录　　2）Public Sub set_file(ByVal handle,ByVal &#160;filename)　读取文件　　3）Public Sub set_var(ByVal Name, ByVal value, ByVal Append)　设置映射数据-替换变量　　4）Public Sub unset_var(ByVal Name)　取消数据映射　　5）Public Sub set_block(ByVal Parent, ByVal BlockTag, ByVal Name)　设置数据块　　6）Public Sub set_unknowns(ByVal unknowns)　设定未指定映射的标记处理方式　　7）Public Sub parse(ByVal Name, ByVal BlockTag, ByVal [...]]]></description>
			<content:encoded><![CDATA[<p>　　每个进行过较大型的ASP-Web应用程序设计的开发人员大概都有如下的经历：ASP代码与页面HTML混淆难分，业务逻辑与显示方式绞合，使得代码难以理解、难以修改；程序编写必须在美工之后，成为项目瓶颈；整合的程序代码和HTML和web应用不容易将数据的处理和数据的显示分开，但在多人合作的情况下，如果无法将数据和显示分开，将大大影响开发的效率，专业分工的发挥。<br/><br/>　　其它的脚本语言，如JSP、PHP都有自己的解决方案，ASP的后一代产品ASP.NET也实现了代码与页面，似乎直接过渡到ASP是不错的选择。但是总有这样或那样的原因让我们不能或暂时不能放弃ASP直奔.NET大营。从公司角度来看，转换语言是一笔不少的投资，包括雇佣熟手.NET程序员、培训原有程序员、开发工具的转型、开发风格的转型、界面风格转变、接口风格、软件架构、文档、开发流程等等；这还意味着原有的代码必须在新语言环境里重写以实现最佳的效果和稳定性；同时将直接影响这段时间内项目的进度，更有可能导致个别程序员出走。由此看来在您决定转换语言之前，在原基础上寻求一种解决方案，才是最好的选择。<span id="more-158"></span><br/>　　PHP通过模板实现代码与页面，可供选择的有FastTemplate、PHPLIB、Smarty等多种，其中PHPLIB的影响最大、使用最多。既然如此，我们直接把它搬到ASP来，对于同时使用PHP和ASP的公司还有很有好处：一、美工处理页面时，不管将要套用PHP还是ASP，处理方式是一样，无须经过培训；二、程序员编写代码时，两种语言间的思路接近或一致，相同功能在两种语言实现时，只需拷贝过来略作修改即可，保证了工作效率和项目进度。 <br/>1、模板类的设计<br/>　　实现代码封装成为模板类，即是为了与PHPLIB兼容，也使得代码方便管理与扩展。<br/>　　模板类要实现的目标为：从模板文件中读入显示的HTML代码，将这些显示代码中需要动态数据的地方替换为ASP程序运算所得出的数据，然后按照一定的顺序输出。其中，替换的部分可以自由的设定。因此它必须完成如下任务：<br/> &nbsp; &nbsp;·从模板文件中读取显示用的HTML代码。<br/> &nbsp; &nbsp;·将模板文件和实际生成的数据结合，生成输出的结果。<br/> &nbsp; &nbsp;·允许同时处理多个模板。<br/> &nbsp; &nbsp;·允许模板的嵌套。<br/> &nbsp; &nbsp;·允许对模板中的某个单独的部分进行处理。<br/><br/>实现方法：<br/> &nbsp; &nbsp;采用FSO读取模板文件<br/> &nbsp; &nbsp;采用正则替换实现模板文件和数据的结合<br/> &nbsp; &nbsp;处理多个模板用数组存储来实现。<br/> &nbsp; &nbsp;模板的嵌套的实现主要的想法是：将模板和输出（任何中间的分析结果）一视同仁，都可拿来做替换，即可实现。<br/> &nbsp; &nbsp;单独部分的处理的通过在模板文件中设定标注，然后在正则替换中结合标注来控制，实现部分替换。<br/><br/>2、模板类的实现<br/>　　给出具体代码之前，先把主要函数列出，用过PHPLIB的朋友应该对此很熟悉了：<br/>　　1）Public Sub set_root(ByVal value)　设定模板默认目录<br/>　　2）Public Sub set_file(ByVal handle,ByVal &nbsp;filename)　读取文件<br/>　　3）Public Sub set_var(ByVal Name, ByVal value, ByVal Append)　设置映射数据-替换变量<br/>　　4）Public Sub unset_var(ByVal Name)　取消数据映射<br/>　　5）Public Sub set_block(ByVal Parent, ByVal BlockTag, ByVal Name)　设置数据块<br/>　　6）Public Sub set_unknowns(ByVal unknowns)　设定未指定映射的标记处理方式<br/>　　7）Public Sub parse(ByVal Name, ByVal BlockTag, ByVal Append)　执行模板文件与数据的结合 <br/>　　8）Public Sub p(ByVal Name)　输出处理结果<br/><br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajax.html" title="AJAX的各种控件和类库">AJAX的各种控件和类库</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aspeaojie.html" title="ASP防注入新方式，希望对大家是有用的">ASP防注入新方式，希望对大家是有用的</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeprn-asp-jpg.html" title="如何删除删不掉的”PRN.asp:.jpg”">如何删除删不掉的”PRN.asp:.jpg”</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/requireeecludexi.html" title="require和include的异同">require和include的异同</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eejaxeeeeee.html" title="使用Ajax时的十个常犯的错误">使用Ajax时的十个常犯的错误</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeieeeeeting.html" title="AJAX初学:IE缓存页面的问题">AJAX初学:IE缓存页面的问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/xmlhttpe.html" title="XMLHTTP对象封装技术">XMLHTTP对象封装技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月22日 -- <a href="http://www.5bay.cn/me/csseeeeyao.html" title="CSS 中的太极拳口诀">CSS 中的太极拳口诀</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/network-programming/phpfengzhuangchangyongjavascriptweijsleiyibiankuaisudiaoyong.html" title="PHP封装常用Javascript为JS类以便快速调用">PHP封装常用Javascript为JS类以便快速调用</a> (1)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/mysqlyouhuajiquanwensousuo.html" title="mysql优化及全文搜索">mysql优化及全文搜索</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/asp" title="ASP" rel="tag">ASP</a>, <a href="http://www.5bay.cn/tag/%E4%BB%A3%E7%A0%81" title="代码" rel="tag">代码</a>, <a href="http://www.5bay.cn/tag/%E5%88%86%E7%A6%BB" title="分离" rel="tag">分离</a>, <a href="http://www.5bay.cn/tag/%E6%A8%A1%E6%9D%BF" title="模板" rel="tag">模板</a>, <a href="http://www.5bay.cn/tag/%E9%A1%B5%E9%9D%A2" title="页面" rel="tag">页面</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/asp/%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF%E5%AE%9E%E7%8E%B0asp%E4%BB%A3%E7%A0%81%E4%B8%8E%E9%A1%B5%E9%9D%A2%E5%88%86%E7%A6%BB.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP-Web 应用程序开发：使用模板</title>
		<link>http://www.5bay.cn/network-programming/php/phpweb%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E5%BC%80%E5%8F%91%EF%BC%9A%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF.html</link>
		<comments>http://www.5bay.cn/network-programming/php/phpweb%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E5%BC%80%E5%8F%91%EF%BC%9A%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF.html#comments</comments>
		<pubDate>Mon, 11 Dec 2006 21:22:08 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[应用程序]]></category>
		<category><![CDATA[模板]]></category>

		<guid isPermaLink="false">?p=153</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/php/phpweb%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E5%BC%80%E5%8F%91%EF%BC%9A%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>　　每个进行过较大型的 PHP-Web 应用程序设计的开发人员大概都有如下的经历：花大量的时间写超文本语句，为页面排版，兼作美工等；或在整合的程序代码在和HTML静态页面时花费大量的时间。的确，用脚本语言开发 Web 应用不容易将数据的处理和数据的显示分开，但在多人合作的情况下，如果无法将数据和显示分开，将大大影响开发的效率，专业分工的发挥。为了解决这个问题，PHP 也提供了自己的解决方案，有多种，本文主要介绍 PHPLIB 中的 Template 类。 一、模板处理类的设计 　　模板处理类主要需完成以下的任务： 从模板文件中读取显示用的HTML代码。 &#160;将模板文件和实际生成的数据结合，生成输出的结果。 允许同时处理多个模板。 允许模板的嵌套。 允许对模板中的某个单独的部分进行处理。 　　归纳上述任务，模板类的设计目标为：从多个模板文件中读入显示的HTML代码，将这些显示代码中需要动态数据的地方替换为PHP程序运算所得出的数据，然后按照一定的顺序输出。其中，替换的部分可以自由的设定。 　　读取显示用的HTML代码采用读文件的方式 　　模板文件和数据的结合采用正则替换 　　处理多个模板用数组存储来实现。 　　模板的嵌套的实现主要的想法是：将模板和输出（任何中间的分析结果）一视同仁，都可拿来做替换，即可实现。 　　单独部分的处理的通过在模板文件中设定标注，然后在正则替换中结合标注来控制，实现部分替换。 二、模板处理类的实现 　　请参看 PHPLib 中的 Template.inc，总共 345 行代码，有详细的注释。以下列举一些主要的函数，供研读参考： 　　1） function set_file（$handle,$filename=” ”） line 77, 读取文件 　　2） function set_var($varname, $value = &#34;&#34;) line 119, 设置映射数据-替换变量 　　3） function set_block($parent, $handle, $name = &#34;&#34;) line 96, [...]]]></description>
			<content:encoded><![CDATA[<p>　　每个进行过较大型的 <a href="http://www.5bay.cn/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">PHP</a>-<a href="http://www.5bay.cn/tag/web" class="st_tag internal_tag" rel="tag" title="标签 web 下的日志">Web</a> 应用程序设计的开发人员大概都有如下的经历：花大量的时间写超文本语句，为页面排版，兼作美工等；或在整合的程序代码在和HTML静态页面时花费大量的时间。的确，用脚本语言开发 <a href="http://www.5bay.cn/tag/web" class="st_tag internal_tag" rel="tag" title="标签 web 下的日志">Web</a> 应用不容易将数据的处理和数据的显示分开，但在多人合作的情况下，如果无法将数据和显示分开，将大大影响开发的效率，专业分工的发挥。为了解决这个问题，PHP 也提供了自己的解决方案，有多种，本文主要介绍 PHPLIB 中的 Template 类。 <span id="more-153"></span><br/><br/>一、模板处理类的设计 <br/>　　模板处理类主要需完成以下的任务： <br/><br/>从模板文件中读取显示用的HTML代码。 &nbsp;<br/>将模板文件和实际生成的数据结合，生成输出的结果。 <br/>允许同时处理多个模板。 <br/>允许模板的嵌套。 <br/>允许对模板中的某个单独的部分进行处理。 <br/><br/><br/>　　归纳上述任务，模板类的设计目标为：从多个模板文件中读入显示的HTML代码，将这些显示代码中需要动态数据的地方替换为PHP程序运算所得出的数据，然后按照一定的顺序输出。其中，替换的部分可以自由的设定。 <br/><br/>　　读取显示用的HTML代码采用读文件的方式 <br/>　　模板文件和数据的结合采用正则替换 <br/>　　处理多个模板用数组存储来实现。 <br/>　　模板的嵌套的实现主要的想法是：将模板和输出（任何中间的分析结果）一视同仁，都可拿来做替换，即可实现。 <br/>　　单独部分的处理的通过在模板文件中设定标注，然后在正则替换中结合标注来控制，实现部分替换。 <br/><br/>二、模板处理类的实现 <br/>　　请参看 PHPLib 中的 Template.inc，总共 345 行代码，有详细的注释。以下列举一些主要的函数，供研读参考： <br/>　　1） function set_file（$handle,$filename=” ”） line 77, 读取文件 <br/>　　2） function set_var($varname, $value = &quot;&quot;) line 119, 设置映射数据-替换变量 <br/>　　3） function set_block($parent, $handle, $name = &quot;&quot;) line 96, 设置标注 <br/>　　4） function subst($handle) line 136, 执行数据替换 <br/>　　5） function parse($target, $handle, $append = false) line 165, 执行模板文件与数据的结合 <br/>　　6） function p($varname) line 268, 输出处理结果 <br/>注：本人下载的php-lib7.2c的Template.inc文件中的第95行少了个“/”，加上后使用正常。 <br/><br/>三、模板处理类的使用 <br/>　　3.1 最基本的例子 <br/>　　为了简单起见，这里假设模板文件、使用模板的PHP文件和模板处理类的文件都放在同一个目录下。PHPLIB中的习惯是使用ihtml后缀为模板文件的后缀。 <br/>　　下面是要使用的模板文件： <br/><br/>&lt;<a href="http://www.5bay.cn/tag/html" class="st_tag internal_tag" rel="tag" title="标签 html 下的日志">html</a>&gt; <br/>&lt;head&gt; <br/>&lt;title&gt;使用模板的测试&lt;/title&gt; <br/>&lt;/head&gt; <br/>&lt;body&gt; <br/>&lt;h2&gt;这是一个使用模板的测试文件！&lt;/h2&gt; <br/>当前的时间是{currenttime}! <br/>&lt;/body&gt; <br/>&lt;/html&gt; <br/><br/>　　注：模板文件和通常的 HTML 文件差不多，唯一不同的是使用“{}”括起来的是可以被模板处理类替换的动态内容的变量。 <br/><br/>　　接下来使用模板处理类来处理上面的模板： <br/><br/>&lt;? <br/>//引入Template类 <br/>include(&quot;template.inc&quot;); <br/><br/>//得到需要替换的数据 <br/>$timeNow=date(&quot;Y-m-d H:i:s&quot;,time()); <br/><br/>//实例化一个Template类 <br/>$template= new Template(); <br/><br/>//载入test.ihtml模板 <br/>$template-&gt;set_file(&quot;handle1&quot;,&quot;test.ihtml&quot;); <br/><br/>//使用$timeNow的值替换模板中的currenttime <br/>$template-&gt;set_var(&quot;currenttime&quot;,$timeNow); <br/><br/>//进行实际的模板操作 <br/>$template-&gt;parse(&quot;output&quot;,&quot;handle1&quot;); <br/><br/>//输出最后结果 <br/>$template-&gt;p(&quot;output&quot;); <br/>?&gt; <br/><br/>　　注：如果只想用PHPLIB中的模板类，只需在文件头包含Template.inc类即可。 创建Template对象时，可以指定模板文件路径，如：new Template（“/htdocs/apps/templates/”），缺省为当前路径。 <br/><br/>　　3.2 模板嵌套与块设定 <br/>　　下面这个例子来自与PHPLIB的参考手册，综合性较强，这里需说明的一点是设定块的目的与嵌套无关，但这个范例包含了两者。请仔细阅读，块设定是为了避免这种情况：原本可在一个模板文件（静态页面）里完成的内容，因需要部分循环，而将部分循环内容提取单独做成模板文件。请思考，如果不用块设定，这个例子是不是需要3个模板文件呢？ <br/>模板文件1，page.ihtml <br/><br/>&lt;html&gt; <br/>&lt;head&gt;&lt;title&gt;{PAGETITLE}&lt;/title&gt;&lt;/head&gt; <br/>&lt;body bgcolor=&quot;#ffffff&quot;&gt; <br/>&lt;table border=1 cellpadding=4 cellspacing=0 bgcolor=&quot;#eeeeee&quot;&gt; <br/>&lt;tr&gt; <br/>&lt;td colspan=2&gt;&lt;h1&gt;{PAGETITLE}&lt;/h1&gt;&lt;/td&gt; <br/>&lt;/tr&gt; <br/>&lt;tr&gt; <br/>&lt;td&gt;{OUT}&lt;/td&gt; <br/>&lt;td&gt;Content&lt;/td&gt; <br/>&lt;/tr&gt; <br/>&lt;/table&gt; <br/>&lt;/body&gt; <br/>&lt;/html&gt; <br/><br/>模板文件2，box.ihtml <br/><br/>&lt;!&#8211; start box.ihtml &#8211;&gt; <br/>&lt;table border=1 bgcolor=&quot;#cccccc&quot; cellpadding=4 cellspacing=0&gt; <br/>&lt;tr&gt; <br/>&lt;td colspan=2&gt;&lt;b&gt;{TITLE}&lt;/b&gt;&lt;/td&gt; <br/>&lt;/tr&gt; <br/>&lt;!&#8211; BEGIN row &#8211;&gt; <br/>&lt;tr&gt; <br/>&lt;td&gt;{NUM}&lt;/td&gt; <br/>&lt;td&gt;{BIGNUM} <br/>&lt;/tr&gt; <br/>&lt;!&#8211; END row &#8211;&gt; <br/>&lt;/table&gt; <br/>&lt;!&#8211; end box.ihtml &#8211;&gt; <br/><br/>模板处理文件，test.php <br/><br/>&lt;?php <br/>//引入Template类 <br/>include(&quot;template.inc&quot;); <br/><br/>#实例化一个Template类，名字叫$t <br/>$t = new Template(); <br/><br/># 建立包含模板文件的数组 <br/>$t-&gt;set_file(array( <br/>&quot;page&quot; =&gt; &quot;page.ihtml&quot;, <br/>&quot;box&quot; =&gt; &quot;box.ihtml&quot;)); <br/><br/># 载入模板文件box中的一个块row,引用名称为rows <br/>$t-&gt;set_block(&quot;box&quot;, &quot;row&quot;, &quot;rows&quot;); <br/><br/># 设置替换 <br/>$t-&gt;set_var(array(&quot;TITLE&quot; =&gt; &quot;Testpage&quot;, <br/>&quot;PAGETITLE&quot; =&gt; &quot;hugo&quot;)); <br/><br/># 生成数据NUM，BIGNUM <br/>for ($i=1; $i&lt;=3; $i++) { <br/> &nbsp; &nbsp;$n = $i; <br/> &nbsp; &nbsp;$nn = $i*10; <br/> &nbsp; &nbsp;#设置替换 <br/> &nbsp; &nbsp;$t-&gt;set_var(array(&quot;NUM&quot; =&gt; $n, &quot;BIGNUM&quot; =&gt; $nn)); <br/> &nbsp; &nbsp;#进行分析，分析的结果添加到rows的后面 <br/> &nbsp; &nbsp;$t-&gt;parse(&quot;rows&quot;, &quot;row&quot;, true); <br/>} <br/><br/># 生成box，再生成page <br/>$t-&gt;parse(&quot;OUT&quot;, array(&quot;box&quot;, &quot;page&quot;)); <br/><br/># 输出最后结果 <br/>$t-&gt;p(&quot;OUT&quot;); <br/>?&gt;<br/><br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aoeempirebakeebshell.html" title="帝国备份王(Empirebak)拿webshell">帝国备份王(Empirebak)拿webshell</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/ep.html" title="让IIS只监听指定IP">让IIS只监听指定IP</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxeeee.html" title="Ajax的工作原理">Ajax的工作原理</a> (1)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/ajaxxuan.html" title="ajax的缺点">ajax的缺点</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eesoneeajaxeehuai.html" title="基于JSON的高级AJAX开发技术">基于JSON的高级AJAX开发技术</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年05月23日 -- <a href="http://www.5bay.cn/server-building/nginxderewriteguize.html" title="nginx的rewrite规则">nginx的rewrite规则</a> (1)</li><li>2006年12月9日 -- <a href="http://www.5bay.cn/network-programming/php/%E5%88%9B%E9%80%A0%E4%B8%96%E7%95%8C%E4%B8%8A%E6%9C%80%E7%AE%80%E5%8D%95%E7%9A%84php%E5%BC%80%E5%8F%91%E6%A8%A1%E5%BC%8F.html" title="创造世界上最简单的 PHP 开发模式">创造世界上最简单的 PHP 开发模式</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/android%e7%ac%94%e8%ae%b0/wangshangzhenglideandroidquanxiandaquan.html" title="网上整理的android权限大全">网上整理的android权限大全</a> (0)</li><li>2010年08月17日 -- <a href="http://www.5bay.cn/server-building/nginxxiansu.html" title="Nginx限速">Nginx限速</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeeeeeee-2.html" title="防止网卡被禁用的具体配置方法">防止网卡被禁用的具体配置方法</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/php" title="PHP" rel="tag">PHP</a>, <a href="http://www.5bay.cn/tag/php" title="PHP" rel="tag">PHP</a>, <a href="http://www.5bay.cn/tag/web" title="web" rel="tag">web</a>, <a href="http://www.5bay.cn/tag/%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F" title="应用程序" rel="tag">应用程序</a>, <a href="http://www.5bay.cn/tag/%E6%A8%A1%E6%9D%BF" title="模板" rel="tag">模板</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/php/phpweb%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E5%BC%80%E5%8F%91%EF%BC%9A%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>创造世界上最简单的 PHP 开发模式</title>
		<link>http://www.5bay.cn/network-programming/php/%E5%88%9B%E9%80%A0%E4%B8%96%E7%95%8C%E4%B8%8A%E6%9C%80%E7%AE%80%E5%8D%95%E7%9A%84php%E5%BC%80%E5%8F%91%E6%A8%A1%E5%BC%8F.html</link>
		<comments>http://www.5bay.cn/network-programming/php/%E5%88%9B%E9%80%A0%E4%B8%96%E7%95%8C%E4%B8%8A%E6%9C%80%E7%AE%80%E5%8D%95%E7%9A%84php%E5%BC%80%E5%8F%91%E6%A8%A1%E5%BC%8F.html#comments</comments>
		<pubDate>Sat, 09 Dec 2006 22:08:51 +0000</pubDate>
		<dc:creator>江小邪</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[开发模式]]></category>
		<category><![CDATA[模板]]></category>

		<guid isPermaLink="false">?p=151</guid>
		<description><![CDATA[<a href="http://www.5bay.cn/network-programming/php/%E5%88%9B%E9%80%A0%E4%B8%96%E7%95%8C%E4%B8%8A%E6%9C%80%E7%AE%80%E5%8D%95%E7%9A%84php%E5%BC%80%E5%8F%91%E6%A8%A1%E5%BC%8F.html"><img align="left" hspace="5" width="150" height="150" src="http://www.5bay.cn/wp-content/plugins/thumbnail-for-excerpts/tfe_no_thumb.png" class="alignleft wp-post-image tfe" alt="" title="" /></a>　　php 作为“最简单”的 Web 脚本语言, 在国内的市场越来越大，phper 越来越多，但是感觉大多数人好像没有考虑到模式问题，什么样的设计模式才是最优的，才是最适合自己目前工作的，毕竟效率是最重要的（用省下的时间打游戏，多美啊&#8230;）。MVC 应该是首选，www.sourceforge.net 上有好多优秀的基于 MVC 的开源项目，大家可以冲过去研究研究。　　前几天给自己公司网站改版，主要还是文章发布系统，老板说后台我想怎么设计就怎么设计，唯一的前提就是快。于是自己搭建了一个简单的发布系统的框架。如果单纯从文章发布系统上讲，基本上可以满足“中小型”企业网站的文章发布系统的要求，后台的总共的php代码不超过800行，而且支持任意扩充和plugin功能。　　废话不再说了，下面把我的架构讲一下，希望对您能有所帮助。　　注意：在开始前，需要您下载一个模板处理工具类：“smarttemplate”，并了解一些模板的简单的使用。　　我的测试环境：windows2k/apache2/php4.3.2/smarttemplate类库　　先讲一下整个web站点的文件的分布，在后面的章节中将陆续创建并填充下面的目录和文件　　我的服务器的web的根目录是 “C:/Apache2/htdocs/”　　我在下面建立了一个文件夹“cmstest”作为我的网站的主文件夹　　文件夹“cmstest”下面的子文件结构是：/config.inc.php/list1.php/list2.php/new.php/add.php/view.php/page.js/src/MysqlUtil.php/src/ArticleUtil.php/src/CoreUtil.php/src/ParseTpl.php/src/lib/smarttemplate/*.* 这个目录用来存放smarttemplate的类库的/smart/template/list1.htm/smart/template/list2.htm/smart/template/new.htm/smart/template/add.htm/smart/template/view.htm/smart/cache//smart/temp/设计步骤：考虑自己公司的网站的特点和已经设计的模板的结构，总结要实现的功能，列出清单。 分析功能清单，把功能分类。每一类的功能都是有共同点的，可以通过相同的方法实现的。 根据功能，设计数据库的表结构 设计一个配置文件config.inc.php, 用来记录网站的一些基本的信息,包括数据库名&#8230;&#8230;.. 为每一类功能设计数据库查询的接口函数，这样以后相似的操作只要调用这个接口就可以了。这样避免了以后可能发生的大量的代码重复的操作，也就达到了代码复用的目的。 定义自己对模板工具的包装函数，以后调用的时候就不用管模板工具的使用问题了，只有往自己的包装函数里面塞数就可以了。 基础函数已经ok了，开始轻松的页面实现和模板的处理了。　　我们现在就开始设计一个简单的系统，看看我是怎么一步一步地实现一个“最简单的文章的发布系统”的，当然只是我模拟的一个简单的项目，实际中一个项目可能比这要复杂的多。一、分析我的案例：呵呵，这个客户项目好简单的啊，幸福ing&#8230;&#8230;&#8230;.list1.php：有三个文章列表和一个按钮，“php开发文章列表”“php开发热点文章列表”“asp开发最新文章”“添加新文章”list2.php：有2个文章列表“asp开发文章列表”“asp开发热点文章列表”new.php：一个添加文章的表单的页面add.php： 处理new.php的表单的页面view.php： 文章察看的页面二、分析功能 “php开发文章列表”“asp开发文章列表”&#8212;&#8212;-按文章的发布顺序，倒序排列显示，每页显示5篇文章“php开发热点文章列表”“asp开发热点文章列表”&#8212;&#8212;-按文章的点击察看次数排序显示文章，显示3篇文章“asp开发最新文章”按文章的发布顺序，倒序排列显示，显示3篇文章“添加新文章”&#8212;&#8212;一个文章的发布功能, 包括文章标题/作者/内容“文章察看”&#8212;&#8212;&#8212;显示某篇文章内容综合的看一下,对功能进行分类包括:1、文章列表：正常的分页列表、按点击数列表、按发布顺序的列表2、文章发布：一个表单的输入和处理3、文章察看：读取显示文章内容呵呵，功能的确是太简单了些。三、设计数据库：数据库名：cmstest数据表：CREATE TABLE `article` (`id` INT NOT NULL AUTO_INCREMENT,`title` VARCHAR( 100 ) NOT NULL ,`content` TEXT NOT NULL ,`datetime` DATETIME NOT NULL ,`clicks` INT( 11 ) ,`pid` TINYINT( 2 ) NOT NULL ,PRIMARY KEY [...]]]></description>
			<content:encoded><![CDATA[<p>　　<a href="http://www.5bay.cn/tag/php" class="st_tag internal_tag" rel="tag" title="标签 PHP 下的日志">php</a> 作为“最简单”的 Web 脚本语言, 在国内的市场越来越大，phper 越来越多，但是感觉大多数人好像没有考虑到模式问题，什么样的设计模式才是最优的，才是最适合自己目前工作的，毕竟效率是最重要的（用省下的时间打游戏，多美啊&#8230;）。MVC 应该是首选，www.sourceforge.net 上有好多优秀的基于 MVC 的开源项目，大家可以冲过去研究研究。<span id="more-151"></span><br/><br/>　　前几天给自己公司网站改版，主要还是文章发布系统，老板说后台我想怎么设计就怎么设计，唯一的前提就是快。于是自己搭建了一个简单的发布系统的框架。如果单纯从文章发布系统上讲，基本上可以满足“中小型”企业网站的文章发布系统的要求，后台的总共的php代码不超过800行，而且支持任意扩充和plugin功能。<br/><br/>　　废话不再说了，下面把我的架构讲一下，希望对您能有所帮助。<br/><br/>　　注意：在开始前，需要您下载一个模板处理工具类：“smarttemplate”，并了解一些模板的简单的使用。<br/><br/>　　我的测试环境：windows2k/apache2/php4.3.2/smarttemplate类库<br/><br/>　　先讲一下整个web站点的文件的分布，在后面的章节中将陆续创建并填充下面的目录和文件<br/>　　我的服务器的web的根目录是 “C:/Apache2/htdocs/”<br/>　　我在下面建立了一个文件夹“cmstest”作为我的网站的主文件夹<br/>　　文件夹“cmstest”下面的子文件结构是：<br/><br/>/config.inc.php<br/>/list1.php<br/>/list2.php<br/>/new.php<br/>/add.php<br/>/view.php<br/>/page.js<br/>/src/MysqlUtil.php<br/>/src/ArticleUtil.php<br/>/src/CoreUtil.php<br/>/src/ParseTpl.php<br/>/src/lib/smarttemplate/*.* 这个目录用来存放smarttemplate的类库的<br/>/smart/template/list1.htm<br/>/smart/template/list2.htm<br/>/smart/template/new.htm<br/>/smart/template/add.htm<br/>/smart/template/view.htm<br/>/smart/cache/<br/>/smart/temp/<br/><br/><br/>设计步骤：<br/><br/>考虑自己公司的网站的特点和已经设计的模板的结构，总结要实现的功能，列出清单。 <br/>分析功能清单，把功能分类。每一类的功能都是有共同点的，可以通过相同的方法实现的。 <br/>根据功能，设计数据库的表结构 <br/>设计一个配置文件config.inc.php, 用来记录网站的一些基本的信息,包括数据库名&#8230;&#8230;.. <br/>为每一类功能设计数据库查询的接口函数，这样以后相似的操作只要调用这个接口就可以了。这样避免了以后可能发生的大量的代码重复的操作，也就达到了代码复用的目的。 <br/>定义自己对模板工具的包装函数，以后调用的时候就不用管模板工具的使用问题了，只有往自己的包装函数里面塞数就可以了。 <br/>基础函数已经ok了，开始轻松的页面实现和模板的处理了。<br/><br/>　　我们现在就开始设计一个简单的系统，看看我是怎么一步一步地实现一个“最简单的文章的发布系统”的，当然只是我模拟的一个简单的项目，实际中一个项目可能比这要复杂的多。<br/><br/><br/>一、分析我的案例：<br/><br/>呵呵，这个客户项目好简单的啊，幸福ing&#8230;&#8230;&#8230;.<br/><br/>list1.php：有三个文章列表和一个按钮，“php开发文章列表”“php开发热点文章列表”“asp开发最新文章”“添加新文章”<br/>list2.php：有2个文章列表“asp开发文章列表”“asp开发热点文章列表”<br/>new.php：一个添加文章的表单的页面<br/>add.php： 处理new.php的表单的页面<br/>view.php： 文章察看的页面<br/><br/>二、分析功能 <br/><br/>“php开发文章列表”“asp开发文章列表”&#8212;&#8212;-按文章的发布顺序，倒序排列显示，每页显示5篇文章<br/>“php开发热点文章列表”“asp开发热点文章列表”&#8212;&#8212;-按文章的点击察看次数排序显示文章，显示3篇文章<br/>“asp开发最新文章”按文章的发布顺序，倒序排列显示，显示3篇文章<br/>“添加新文章”&#8212;&#8212;一个文章的发布功能, 包括文章标题/作者/内容<br/>“文章察看”&#8212;&#8212;&#8212;显示某篇文章内容<br/><br/>综合的看一下,对功能进行分类包括:<br/>1、文章列表：正常的分页列表、按点击数列表、按发布顺序的列表<br/>2、文章发布：一个表单的输入和处理<br/>3、文章察看：读取显示文章内容<br/><br/>呵呵，功能的确是太简单了些。<br/><br/>三、设计数据库：<br/><br/>数据库名：cmstest<br/><br/>数据表：<br/><br/>CREATE TABLE `article` (<br/>`id` INT NOT NULL AUTO_INCREMENT,<br/>`title` VARCHAR( 100 ) NOT NULL ,<br/>`content` TEXT NOT NULL ,<br/>`datetime` DATETIME NOT NULL ,<br/>`clicks` INT( 11 ) ,<br/>`pid` TINYINT( 2 ) NOT NULL ,<br/>PRIMARY KEY ( `id` ) <br/>);<br/><br/>CREATE TABLE `cat` (<br/>`cid` TINYINT( 2 ) NOT NULL ,<br/>`cname` VARCHAR( 20 ) NOT NULL ,<br/>PRIMARY KEY ( `cid` ) <br/>);<br/><br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br/>article表是文章内容表，<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>`id` 文章编号<br/>`title` 文章标题<br/>`content` 文章内容<br/>`datetime` 发布时间<br/>`clicks` 点击数<br/>`pid` 分类表号<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br/>cat表是文章的类别表<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>`cid` 分类表号<br/>`cname` 分类名称<br/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br/><br/>上面是表的数据库结构，光有了这些还不够，还要有数据<br/>INSERT INTO `cat` VALUES(1, &quot;php开发&quot;),(2, &quot;asp开发&quot;);<br/>INSERT INTO `article` VALUES(1, &quot;php开发1&quot;, &quot;php开发1内容&quot;, &quot;2004-8-1 1:1:1&quot;, 0, 1);<br/>INSERT INTO `article` VALUES(2, &quot;php开发2&quot;, &quot;php开发2内容&quot;, &quot;2004-8-2 1:1:1&quot;, 0, 1);<br/>INSERT INTO `article` VALUES(3, &quot;php开发3&quot;, &quot;php开发3内容&quot;, &quot;2004-8-3 1:1:1&quot;, 4, 1);<br/>INSERT INTO `article` VALUES(4, &quot;php开发4&quot;, &quot;php开发4内容&quot;, &quot;2004-8-4 1:1:1&quot;, 3, 1);<br/>INSERT INTO `article` VALUES(5, &quot;php开发5&quot;, &quot;php开发5内容&quot;, &quot;2004-8-5 1:1:1&quot;, 2, 1);<br/>INSERT INTO `article` VALUES(6, &quot;php开发6&quot;, &quot;php开发6内容&quot;, &quot;2004-8-6 1:1:1&quot;, 1, 1);<br/>INSERT INTO `article` VALUES(7, &quot;php开发7&quot;, &quot;php开发7内容&quot;, &quot;2004-8-7 1:1:1&quot;, 0, 1);<br/>INSERT INTO `article` VALUES(8, &quot;jsp开发1&quot;, &quot;jsp开发1内容&quot;, &quot;2004-8-1 1:1:1&quot;, 0, 2);<br/>INSERT INTO `article` VALUES(9, &quot;jsp开发2&quot;, &quot;jsp开发2内容&quot;, &quot;2004-8-2 1:1:1&quot;, 0, 2);<br/>INSERT INTO `article` VALUES(10, &quot;jsp开发3&quot;, &quot;jsp开发3内容&quot;, &quot;2004-8-3 1:1:1&quot;, 4, 2);<br/>INSERT INTO `article` VALUES(11, &quot;jsp开发4&quot;, &quot;jsp开发4内容&quot;, &quot;2004-8-4 1:1:1&quot;, 3, 2);<br/>INSERT INTO `article` VALUES(12, &quot;jsp开发5&quot;, &quot;jsp开发5内容&quot;, &quot;2004-8-5 1:1:1&quot;, 2, 2);<br/>INSERT INTO `article` VALUES(13, &quot;jsp开发6&quot;, &quot;jsp开发6内容&quot;, &quot;2004-8-6 1:1:1&quot;, 1, 2);<br/>INSERT INTO `article` VALUES(14, &quot;jsp开发7&quot;, &quot;jsp开发7内容&quot;, &quot;2004-8-7 1:1:1&quot;, 0, 2);<br/><br/><br/>这样我们的数据库就设计完了。接下来就开始涉及到具体的实现了。<br/><br/>四、设计config.inc.php文件<br/><br/>这个文件用来设置一些web上通用的数据信息和一些参数，其他的具体的实现页面都通过这个页面获取需要的数据，下面是配置的清单<br/><br/>&lt;?php <br/><br/>//数据库设置 <br/>define(&#039;DB_USERNAME&#039;, &#039;root&#039;); <br/>define(&#039;DB_PASSWORD&#039;, &#039;&#039;); <br/>define(&#039;DB_HOST&#039;, &#039;localhost&#039;); <br/>define(&#039;DB_NAME&#039;, &#039;cmstest&#039;); <br/>define(&#039;DB_PCONNECT&#039;, true); <br/><br/>// web的基本路经设置 <br/>define(&#039;CMS_ROOT&#039;, &#039;C:/Apache2/htdocs/cmstest/&#039;); <br/>define(&#039;CMS_SRCPATH&#039;, CMS_ROOT.&#039;src/&#039;); <br/><br/>//smarttemplate 模板解析工具的设置 <br/>define(&#039;SMART_REUSE_CODE&#039;, false); <br/>define(&#039;SMART_TEMPLATE_DIR&#039;, CMS_ROOT.&#039;smart/template/&#039;); <br/>define(&#039;SMART_TEMP_DIR&#039;, CMS_ROOT.&#039;smart/temp/&#039;); <br/>define(&#039;SMART_CACHE_DIR&#039;, CMS_ROOT.&#039;smart/cache/&#039;); <br/>define(&#039;SMART_CACHE_LIFETIME&#039;, 100); <br/>require_once(CMS_SRCPATH . &#039;lib/smarttemplate/class.smarttemplate.php&#039;); <br/><br/>//要包含的基础文件,里面都是一些基本的函数 <br/>require_once CMS_SRCPATH.&#039;MysqlUtil.php&#039;; <br/>require_once CMS_SRCPATH.&#039;ArticleUtil.php&#039;; <br/>require_once CMS_SRCPATH.&#039;CoreUtil.php&#039;; <br/>require_once CMS_SRCPATH.&#039;ParseTpl.php&#039;; <br/><br/>//session 控制 <br/>session_cache_limiter(&#039;private_no_expire&#039;); <br/>session_start(); <br/><br/>?&gt; <br/><br/><br/>　　其中的 define(&#039;CMS_ROOT&#039;, &#039;C:/Apache2/htdocs/cmstest/&#039;); 路经根据自己apach的web路经来改（参照最开始介绍文件夹结构的地方改）。<br/><br/><br/>五、制作功能接口（1）<br/><br/>　　首先对 &nbsp;mysql 数据库函数进行包装，简化对数据库操作，网上有很多这样的开源的类。但是这里我个人根据自己的需求和习惯，自己对 mysql 的函数进行了包装，写得好坏就先不管了。这个地方简单的看一下就可以了，不同的包装的类操作是不同的，而且这里的主要目的是理解这套“架构”，不用太扣代码。<br/><br/>&#8212;&#8212;-MysqlUtil.php&#8212;&#8212;&#8211;<br/>&lt;?php <br/><br/>function dbConnect(){ <br/> &nbsp; &nbsp;global $cnn; <br/> &nbsp; &nbsp;$cnn = (DB_PCONNECT? mysql_pconnect(DB_HOST, DB_NAME, DB_PASSWORD): <br/> &nbsp; &nbsp;mysql_connect(DB_HOST, DB_NAME, DB_PASSWORD)) or <br/> &nbsp; &nbsp;die(&#039;数据库连接错误&#039;); <br/> &nbsp; &nbsp;mysql_select_db(DB_NAME, $cnn) or die(&#039;数据库选择错误&#039;); <br/> &nbsp; &nbsp;mysql_query(&quot;SET AUTOCOMMIT=1&quot;); <br/>} <br/><br/>function &amp;dbQuery($sql){ <br/> &nbsp; &nbsp;global $cnn; <br/> &nbsp; &nbsp;$rs = &amp;mysql_query($sql, $cnn); <br/> &nbsp; &nbsp;while($item=mysql_fetch_assoc($rs)){ <br/> &nbsp; &nbsp; &nbsp; &nbsp;$data[] = $item; <br/> &nbsp; &nbsp;} <br/> &nbsp; &nbsp;return $data; <br/>} <br/><br/>function &amp;dbGetRow($sql){ <br/> &nbsp; &nbsp;global $cnn; <br/> &nbsp; &nbsp;$rs = mysql_query($sql) or die(&#039;sql语句执行错误&#039;); <br/> &nbsp; &nbsp;if(mysql_num_rows($rs)&gt;0) <br/> &nbsp; &nbsp;return mysql_fetch_assoc($rs); <br/> &nbsp; &nbsp;else <br/> &nbsp; &nbsp;return null; <br/>} <br/><br/>function dbGetOne($sql, $fildName){ <br/> &nbsp; &nbsp;$rs = dbGetRow($sql); <br/> &nbsp; &nbsp;return sizeof($rs)==null? null: (isset($rs[$fildName])? $rs[$fildName]: null); <br/>} <br/><br/>function &amp;dbPageQuery($sql, $page=1, $pageSize=20){ <br/> &nbsp; &nbsp;if($page===null) return dbQuery($sql); <br/> &nbsp; &nbsp;$countSql = preg_replace(&#039;&#124;SELECT.*FROM&#124;i&#039;,&#039;SELECT COUNT(*) count FROM&#039;, $sql); <br/> &nbsp; &nbsp;$n = (int)dbGetOne($countSql, &#039;count&#039;); <br/> &nbsp; &nbsp;$data[&#039;pageSize&#039;] = (int)$pageSize&lt;1? 20: (int)$pageSize; <br/> &nbsp; &nbsp;$data[&#039;recordCount&#039;] = $n; <br/> &nbsp; &nbsp;$data[&#039;pageCount&#039;] = ceil($data[&#039;recordCount&#039;]/$data[&#039;pageSize&#039;]); <br/> &nbsp; &nbsp;$data[&#039;page&#039;] = $data[&#039;pageCount&#039;]==0? 0: ((int)$page&lt;1? 1: (int)$page); <br/> &nbsp; &nbsp;$data[&#039;page&#039;] = $data[&#039;page&#039;]&gt;$data[&#039;pageCount&#039;]? $data[&#039;pageCount&#039;]:$data[&#039;page&#039;]; <br/> &nbsp; &nbsp;$data[&#039;isFirst&#039;] = $data[&#039;page&#039;]&gt;1? false: true; <br/> &nbsp; &nbsp;$data[&#039;isLast&#039;] = $data[&#039;page&#039;]&lt;$data[&#039;pageCount&#039;]? false: true; <br/> &nbsp; &nbsp;$data[&#039;start&#039;] = ($data[&#039;page&#039;]==0)? 0: ($data[&#039;page&#039;]-1)*$data[&#039;pageSize&#039;]+1; <br/> &nbsp; &nbsp;$data[&#039;end&#039;] = ($data[&#039;start&#039;]+$data[&#039;pageSize&#039;]-1); <br/> &nbsp; &nbsp;$data[&#039;end&#039;] = $data[&#039;end&#039;]&gt;$data[&#039;recordCount&#039;]? $data[&#039;recordCount&#039;]: $data[&#039;end&#039;]; <br/> &nbsp; &nbsp;$data[&#039;sql&#039;] = $sql.&#039; LIMIT &#039;.($data[&#039;start&#039;]-1).&#039;,&#039;.$data[&#039;pageSize&#039;]; <br/> &nbsp; &nbsp;$data[&#039;data&#039;] = &amp;dbQuery($data[&#039;sql&#039;]); <br/> &nbsp; &nbsp;return $data; <br/>} <br/><br/>function dbExecute($sql){ <br/> &nbsp; &nbsp;global $cnn; <br/> &nbsp; &nbsp;mysql_query($sql, $cnn) or die(&#039;sql语句执行错误&#039;); <br/> &nbsp; &nbsp;return mysql_affected_rows($cnn); <br/>} <br/><br/>function dbDisconnect(){ <br/> &nbsp; &nbsp;global $cnn; <br/> &nbsp; &nbsp;mysql_close($cnn); <br/>} <br/><br/>function sqlGetOneById($table, $field, $id){ <br/> &nbsp; &nbsp;return &quot;SELECT * FROM $table WHERE $field=$id&quot;; <br/>} <br/><br/>function sqlMakeInsert($table, $data){ <br/> &nbsp; &nbsp;$t1 = $t2 = array(); <br/> &nbsp; &nbsp;foreach($data as $key=&gt;$value){ <br/> &nbsp; &nbsp; &nbsp; &nbsp;$t1[] = $key; <br/> &nbsp; &nbsp; &nbsp; &nbsp;$t2[] = &quot;&#039;&quot;.addslashes($value).&quot;&#039;&quot;; <br/> &nbsp; &nbsp;} <br/> &nbsp; &nbsp;return &quot;INSERT INTO $table (&quot;.implode(&quot;,&quot;,$t1).&quot;) VALUES(&quot;.implode(&quot;,&quot;,$t2).&quot;)&quot;; <br/>} <br/><br/>function sqlMakeUpdateById($table, $field, $id, $data){ <br/> &nbsp; &nbsp;$t1 = array(); <br/> &nbsp; &nbsp;foreach($data as $key=&gt;$value){ <br/> &nbsp; &nbsp; &nbsp; &nbsp;$t1[] = &quot;$key=&#039;&quot;.addslashes($value).&quot;&#039;&quot;; <br/> &nbsp; &nbsp;} <br/> &nbsp; &nbsp;return &quot;UPDATE $table SET &quot;.implode(&quot;,&quot;, $t1).&quot; WHERE $field=$id&quot;; <br/>} <br/><br/>function sqlMakeDelById($table, $field, $id){ <br/> &nbsp; &nbsp;return &quot;DELETE FROM $table WHERE $field=$id&quot;; <br/>} <br/><br/>?&gt; <br/><br/>五、制作功能接口（2）<br/><br/>下面来正式的看看，我们共要实现的功能进行的包装<br/><br/>&#8212;&#8212;&#8212;&#8212;ArticleUtil.php&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>&lt;?php <br/>//显示文章列表的函数 <br/>//getArticleList(文章类别, 排序方法, 当前显示第几页, 每页显示几条) <br/>function getArticleList($catId, $order, $page, $pageSize){ <br/> &nbsp; &nbsp;$sql = &quot;SELECT * FROM article WHERE pid=$catId ORDER BY $order&quot;; <br/> &nbsp; &nbsp;return dbPageQuery($sql, $page, $pageSize); <br/>} <br/>//查询某个文章的内容 <br/>//getArticle(文章编号) <br/>function getArticle($id){ <br/> &nbsp; &nbsp;$sqlUpdate = &quot;UPDATE article SET clicks=clicks+1 WHERE id=$id&quot;; <br/> &nbsp; &nbsp;dbExecute($sqlUpdate); <br/> &nbsp; &nbsp;$sql = &quot;SELECT * FROM article WHERE art_id=$id&quot;; <br/> &nbsp; &nbsp;return dbGetRow($sql); <br/>} <br/>//添加文章 <br/>//addArticle(文章内容数组) <br/>function addArticle($data){ <br/> &nbsp; &nbsp;$sql = sqlMakeInsert(&#039;article&#039;, $data); <br/> &nbsp; &nbsp;return dbExecute($sql); <br/>} <br/>?&gt; <br/><br/>这段代码是不是就简单多了啊？这就是自己对mysql函数进行包装的好处！<br/>下面来研究一下他们是怎么实现我们的功能的呢。<br/>“php开发文章列表”&#8212;&#8212;&#8211;getArticleList(1, &quot;id DESC&quot;, $page, 5) <br/>“asp开发文章列表”&#8212;&#8212;&#8211;getArticleList(2, &quot;id DESC&quot;, $page, 5)<br/>“php开发热点文章列表”&#8212;-getArticleList(1, &quot;clicks DESC, id DESC&quot;, 1, 3)<br/>“asp开发热点文章列表”&#8212;-getArticleList(2, &quot;clicks DESC, id DESC&quot;, 1, 3)<br/>“asp开发最新文章”&#8212;&#8212;&#8211;getArticleList(2, &quot;id DESC&quot;, 1, 3)<br/>“添加新文章”&#8212;&#8212;&#8212;&#8212;-addArticle($data)<br/>“察看文章”&#8212;&#8212;&#8212;&#8212;&#8212;getArticle($id)<br/><br/><br/>六、对smarttemplate类进行包装（革命尚未成功，同志仍须努力）<br/><br/>具体的smarttemplate的使用这里就不讲了，不然口水讲没了，都讲不完。下面这个是具体的对包装函数<br/><br/>&#8212;&#8212;&#8212;&#8212;-ParseTpl.php&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>&lt;?php <br/><br/>function renderTpl($viewFile, $data){ <br/> &nbsp; &nbsp;$page = new SmartTemplate($viewFile); <br/> &nbsp; &nbsp;foreach($data as $key=&gt;$value){ <br/> &nbsp; &nbsp; &nbsp; &nbsp;if(isset($value[data])){ <br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$page-&gt;assign($key, $value[data]); <br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;unset($value[data]); <br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$page-&gt;assign($key.&quot;_page&quot;, $value); <br/> &nbsp; &nbsp; &nbsp; &nbsp;} else { <br/> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;$page-&gt;assign($key, $value); <br/> &nbsp; &nbsp; &nbsp; &nbsp;} <br/> &nbsp; &nbsp;} <br/> &nbsp; &nbsp;$page-&gt;output(); <br/>} <br/><br/>?&gt; <br/><br/>七：文章列表察看页面实现和模板处理（万里长征的最后一步）<br/><br/>先来看看页面list1的实现,在list1里面分页用了一个page.js文件，这个文件是自己给自己写的一个js分页的函数，挺好用的<br/>&#8212;&#8212;&#8212;&#8212;&#8212;page.js&#8212;&#8212;&#8212;&#8212;&#8212;<br/><br/>//&#8212;&#8212;&#8211;共 20 条记录，当前 86/99 页 [1]&#8230; [82] [83] [84] [85] [86] [87] [88] [89] [90] &#8230;[99] GO&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>//recordCount = 20;<br/>//show = 20<br/>//pageShow = 11;<br/>//pageCount = 100;<br/>//pageNow = 86;<br/>//pageStr = &quot;?page=_page_&quot;;<br/>//document.write(showListPage(recordCount, show, pageCount, pageNow, pageStr));<br/>function showListPage(recordCount, show, pageShow, pageCount, pageNow, pageStr){<br/> &nbsp; &nbsp;if(pageCount&lt;1) pageCount =0;<br/> &nbsp; &nbsp;if(pageNow&lt;1) pageNow = 0;<br/> &nbsp; &nbsp;str = &#039;共 &lt;B&gt;&#039;+recordCount+&#039;&lt;/B&gt; 条记录，当前 &lt;B&gt;&#039;+pageNow+&#039;/&#039;+pageCount+&#039;&lt;/B&gt; 页 &#039;;<br/><br/> &nbsp; &nbsp;if(pageCount&lt;=pageShow){<br/> &nbsp; &nbsp; &nbsp; &nbsp;startHave = false;<br/> &nbsp; &nbsp; &nbsp; &nbsp;endHave = false;<br/> &nbsp; &nbsp; &nbsp; &nbsp;startNum = 1;<br/> &nbsp; &nbsp; &nbsp; &nbsp;endNum = pageCount;<br/> &nbsp; &nbsp;} else if(pageNow-1 &lt;= pageShow/2){<br/> &nbsp; &nbsp; &nbsp; &nbsp;startHave = false;<br/> &nbsp; &nbsp; &nbsp; &nbsp;endHave = true;<br/> &nbsp; &nbsp; &nbsp; &nbsp;startNum = 1;<br/> &nbsp; &nbsp; &nbsp; &nbsp;endNum = pageShow-1;<br/> &nbsp; &nbsp;} else if(pageCount-pageNow &lt;= pageShow/2){<br/> &nbsp; &nbsp; &nbsp; &nbsp;startHave = true;<br/> &nbsp; &nbsp; &nbsp; &nbsp;endHave = false;<br/> &nbsp; &nbsp; &nbsp; &nbsp;startNum = pageCount &#8211; pageShow + 2;<br/> &nbsp; &nbsp; &nbsp; &nbsp;endNum = pageCount;<br/> &nbsp; &nbsp;} else {<br/> &nbsp; &nbsp; &nbsp; &nbsp;startHave = true;<br/> &nbsp; &nbsp; &nbsp; &nbsp;endHave = true;<br/> &nbsp; &nbsp; &nbsp; &nbsp;startNum = pageNow &#8211; Math.floor((pageShow-2)/2);<br/> &nbsp; &nbsp; &nbsp; &nbsp;endNum = startNum + pageShow &#8211; 3;<br/> &nbsp; &nbsp;}<br/><br/> &nbsp; &nbsp;if(startHave){<br/> &nbsp; &nbsp; &nbsp; &nbsp;startStr = &quot; [&lt;A href=&#039;&quot;+pageStr.replace(&quot;_page_&quot;,1)+&quot;&#039;&gt;1&lt;/A&gt;]&#8230; &quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;str += startStr;<br/> &nbsp; &nbsp;}<br/><br/> &nbsp; &nbsp;for(i=startNum; i&lt;=endNum; i++){<br/> &nbsp; &nbsp; &nbsp; &nbsp;if(pageNow==i)<br/> &nbsp; &nbsp; &nbsp; &nbsp;str += &quot;[&quot; + i + &quot;]&quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;else<br/> &nbsp; &nbsp; &nbsp; &nbsp;str += &quot; [&lt;A href=&#039;&quot; + pageStr.replace(&quot;_page_&quot;,i) + &quot;&#039;&gt;&quot; + i + &quot;&lt;/A&gt;] &quot;;<br/> &nbsp; &nbsp;}<br/><br/> &nbsp; &nbsp;if(endHave){<br/> &nbsp; &nbsp; &nbsp; &nbsp;endStr = &quot; &#8230;[&lt;A href=&#039;&quot; + pageStr.replace(&quot;_page_&quot;,pageCount) + &quot;&#039;&gt;&quot; + pageCount + &quot;&lt;/A&gt;] &quot;;<br/> &nbsp; &nbsp; &nbsp; &nbsp;str += endStr;<br/> &nbsp; &nbsp;}<br/> &nbsp; &nbsp;return str;<br/>}<br/><br/>&#8212;&#8212;&#8212;&#8212;&#8211;list1.htm&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>&lt;a href=&quot;new.php&quot;&gt;添加新文章&lt;/a&gt;&lt;hr&gt;<br/>&lt;table&gt;<br/>&lt;tr&gt;&lt;th&gt;php开发文章&lt;/th&gt;&lt;/tr&gt;<br/>&lt;!&#8211; BEGIN phplist &#8211;&gt;<br/>&lt;tr&gt;&lt;td&gt;{id}&#8211;&lt;a href=&quot;view.php?id={id}&quot;&gt;{title}&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;<br/>&lt;!&#8211; END phplist &#8211;&gt;<br/>&lt;/table&gt;<br/>&lt;!&#8211; BEGIN phplist_page &#8211;&gt;<br/>&lt;script src=&quot;page.js&quot; language=&quot;javascript&quot;&gt;&lt;/script&gt;<br/>&lt;script language=&quot;javascript&quot;&gt;<br/>recordCount = {recordCount}; //总记录数<br/>show = {pageSize}; //每页显示的记录数量<br/>pageShow = 10; //每页显示的分页连接数量<br/>pageCount = {pageCount}; //总页数<br/>pageNow = {page}; //当前页数<br/>pageStr = &quot;?page=_page_&quot;; //页面连接<br/>document.write(showListPage(recordCount, show, pageShow, pageCount, pageNow, pageStr));<br/>&lt;/script&gt;<br/>&lt;!&#8211; END phplist_page &#8211;&gt;<br/>&lt;hr&gt;<br/>&lt;table ID=&quot;Table1&quot;&gt;<br/>&lt;tr&gt;&lt;th&gt;php开发热点文章&lt;/th&gt;&lt;/tr&gt;<br/>&lt;!&#8211; BEGIN phphotlist &#8211;&gt;<br/>&lt;tr&gt;&lt;td&gt;{id}&#8211;&lt;a href=&quot;view.php?id={id}&quot;&gt;{title}&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;<br/>&lt;!&#8211; END phphotlist &#8211;&gt;<br/>&lt;/table&gt;&lt;hr&gt;<br/>&lt;table ID=&quot;Table2&quot;&gt;<br/>&lt;tr&gt;&lt;th&gt;asp开发最新文章&lt;/th&gt;&lt;/tr&gt;<br/>&lt;!&#8211; BEGIN aspnewlist &#8211;&gt;<br/>&lt;tr&gt;&lt;td&gt;{id}&#8211;&lt;a href=&quot;view.php?id={id}&quot;&gt;{title}&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;<br/>&lt;!&#8211; END aspnewlist &#8211;&gt;<br/>&lt;/table&gt;<br/><br/><br/>&#8212;&#8212;&#8212;&#8212;&#8211;list1.php&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>&lt;?php <br/><br/>require_once &quot;config.inc.php&quot;; <br/><br/>dbConnect(); <br/>$data = array(); <br/>$data[phplist] = getArticleList(1, &quot;id DESC&quot;, (int)$_GET[page], 5); <br/>$data[phphotlist] = getArticleList(1, &quot;clicks DESC, id DESC&quot;, 1, 3); <br/>$data[aspnewlist] = getArticleList(2, &quot;id DESC&quot;, 1, 3); <br/>dbDisconnect(); <br/><br/>renderTpl(&#039;list1.htm&#039;, $data); <br/><br/>?&gt; <br/><br/><br/>运行的效果怎么样，是不是实现了要求的功能呢。现在我们再做一下改动，在里面加上“asp开发热点文章列表”，实现代码如下<br/><br/>&#8212;&#8212;&#8212;&#8212;&#8211;list1.htm&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>&lt;a href=&quot;new.php&quot;&gt;添加新文章&lt;/a&gt;&lt;hr&gt;<br/>&lt;table&gt;<br/>&lt;tr&gt;&lt;th&gt;php开发文章&lt;/th&gt;&lt;/tr&gt;<br/>&lt;!&#8211; BEGIN phplist &#8211;&gt;<br/>&lt;tr&gt;&lt;td&gt;{id}&#8211;&lt;a href=&quot;view.php?id={id}&quot;&gt;{title}&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;<br/>&lt;!&#8211; END phplist &#8211;&gt;<br/>&lt;/table&gt;<br/>&lt;!&#8211; BEGIN phplist_page &#8211;&gt;<br/>&lt;script src=&quot;page.js&quot; language=&quot;javascript&quot;&gt;&lt;/script&gt;<br/>&lt;script language=&quot;javascript&quot;&gt;<br/>recordCount = {recordCount}; //总记录数<br/>show = {pageSize}; //每页显示的记录数量<br/>pageShow = 10; //每页显示的分页连接数量<br/>pageCount = {pageCount}; //总页数<br/>pageNow = {page}; //当前页数<br/>pageStr = &quot;?page=_page_&quot;; //页面连接<br/>document.write(showListPage(recordCount, show, pageShow, pageCount, pageNow, pageStr));<br/>&lt;/script&gt;<br/>&lt;!&#8211; END phplist_page &#8211;&gt;<br/>&lt;hr&gt;<br/>&lt;table ID=&quot;Table1&quot;&gt;<br/>&lt;tr&gt;&lt;th&gt;php开发热点文章&lt;/th&gt;&lt;/tr&gt;<br/>&lt;!&#8211; BEGIN phphotlist &#8211;&gt;<br/>&lt;tr&gt;&lt;td&gt;{id}&#8211;&lt;a href=&quot;view.php?id={id}&quot;&gt;{title}&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;<br/>&lt;!&#8211; END phphotlist &#8211;&gt;<br/>&lt;/table&gt;&lt;hr&gt;<br/>&lt;table ID=&quot;Table2&quot;&gt;<br/>&lt;tr&gt;&lt;th&gt;asp开发最新文章&lt;/th&gt;&lt;/tr&gt;<br/>&lt;!&#8211; BEGIN aspnewlist &#8211;&gt;<br/>&lt;tr&gt;&lt;td&gt;{id}&#8211;&lt;a href=&quot;view.php?id={id}&quot;&gt;{title}&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;<br/>&lt;!&#8211; END aspnewlist &#8211;&gt;<br/>&lt;/table&gt;<br/>&lt;table ID=&quot;Table3&quot;&gt;<br/>&lt;tr&gt;&lt;th&gt;asp热点文章&lt;/th&gt;&lt;/tr&gt;<br/>&lt;!&#8211; BEGIN asphotlist &#8211;&gt;<br/>&lt;tr&gt;&lt;td&gt;{id}&#8211;&lt;a href=&quot;view.php?id={id}&quot;&gt;{title}&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;<br/>&lt;!&#8211; END asphotlist &#8211;&gt;<br/>&lt;/table&gt;<br/><br/><br/>&#8212;&#8212;&#8212;&#8212;&#8211;list1.php&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>&lt;?php <br/><br/>require_once &quot;config.inc.php&quot;; <br/><br/>dbConnect(); <br/>$data = array(); <br/>$data[phplist] = getArticleList(1, &quot;id DESC&quot;, (int)$_GET[page], 5); <br/>$data[phphotlist] = getArticleList(1, &quot;clicks DESC, id DESC&quot;, 1, 3); <br/>$data[aspnewlist] = getArticleList(2, &quot;id DESC&quot;, 1, 3); <br/>$data[asphotlist] = getArticleList(2, &quot;clicks DESC, id DESC&quot;, 1, 3); <br/>dbDisconnect(); <br/><br/>renderTpl(&#039;list1.htm&#039;, $data); <br/><br/>?&gt; <br/><br/>　　仔细观察一下前后的区别，list1.php里面只是简单的加入了一行的代码，就实现这个改动，感觉怎么样啊？是不是超级简单。<br/><br/>其实这种设计模式的好处还不只是这点：<br/>1、可以把程序的核心代码隔离开管理，便于以后程序的管理维护<br/>2、对于程序的可扩展性也很好，假设list1.php中要加入产品列表，我是不是也可以这么做呢？把对产品的管理也写成统一的数据库操作接口，然后简单的修改模板文件加入产品列表部分，最后在list1.php中加入一行函数调用的代码，就可以实现。<br/>3、代码复用，如果您是做中小型企业网站的，那这么做对您的好处是最大的，因为这种类型的网站的设计结构几乎是一样的，您可能只需要更改一下模板的样式，就可以赚到钞票了。<br/><br/>　　这么看来这种模式是不是给您带来了很多的好处呢？<br/><br/><br/>&#8212;&#8212;&#8212;&#8211;lsit2.htm&#8212;&#8212;&#8212;&#8212;&#8212;<br/>&lt;a href=&quot;new.php&quot;&gt;添加新文章&lt;/a&gt;&lt;hr&gt;<br/>&lt;table ID=&quot;Table1&quot;&gt;<br/>&lt;tr&gt;&lt;th&gt;asp开发文章&lt;/th&gt;&lt;/tr&gt;<br/>&lt;!&#8211; BEGIN asplist &#8211;&gt;<br/>&lt;tr&gt;&lt;td&gt;{id}&#8211;&lt;a href=&quot;view.php?id={id}&quot;&gt;{title}&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;<br/>&lt;!&#8211; END asplist &#8211;&gt;<br/>&lt;/table&gt;<br/>&lt;!&#8211; BEGIN asplist_page &#8211;&gt;<br/>&lt;script src=&quot;page.js&quot; language=&quot;javascript&quot;&gt;&lt;/script&gt;<br/>&lt;script language=&quot;javascript&quot;&gt;<br/>recordCount = {recordCount}; //总记录数<br/>show = {pageSize}; //每页显示的记录数量<br/>pageShow = 10; //每页显示的分页连接数量<br/>pageCount = {pageCount}; //总页数<br/>pageNow = {page}; //当前页数<br/>pageStr = &quot;?page=_page_&quot;; //页面连接<br/>document.write(showListPage(recordCount, show, pageShow, pageCount, pageNow, pageStr));<br/>&lt;/script&gt;<br/>&lt;!&#8211; END asplist_page &#8211;&gt;<br/>&lt;hr&gt;<br/>&lt;table ID=&quot;Table4&quot;&gt;<br/>&lt;tr&gt;&lt;th&gt;asp热点文章&lt;/th&gt;&lt;/tr&gt;<br/>&lt;!&#8211; BEGIN asphotlist &#8211;&gt;<br/>&lt;tr&gt;&lt;td&gt;{id}&#8211;&lt;a href=&quot;view.php?id={id}&quot;&gt;{title}&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;<br/>&lt;!&#8211; END asphotlist &#8211;&gt;<br/>&lt;/table&gt;<br/><br/><br/>&#8212;&#8212;&#8212;&#8211;lsit2.php&#8212;&#8212;&#8212;&#8212;&#8212;<br/>&lt;?php <br/><br/>require_once &quot;config.inc.php&quot;; <br/><br/>dbConnect(); <br/>$data = array(); <br/>$data[asplist] = getArticleList(2, &quot;id DESC&quot;, (int)$_GET[page], 5); <br/>$data[asphotlist] = getArticleList(2, &quot;clicks DESC, id DESC&quot;, 1, 3); <br/>dbDisconnect(); <br/><br/>renderTpl(&#039;list2.htm&#039;, $data); <br/><br/>?&gt; <br/><br/>&#8212;&#8212;&#8211;view.htm&#8212;&#8212;&#8212;&#8212;&#8211;<br/>&lt;!&#8211; BEGIN content &#8211;&gt;<br/>编号:{id}&lt;br&gt;标题:{title}&lt;br&gt;内容:{content}<br/>&lt;!&#8211; END content &#8211;&gt;<br/><br/><br/>&#8212;&#8212;&#8211;view.php&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br/>&lt;?php <br/><br/>require_once &quot;config.inc.php&quot;; <br/><br/>dbConnect(); <br/>$data = array(); <br/>$data[content] = getArticle((int)$_GET[id]); <br/>dbDisconnect(); <br/><br/>renderTpl(&#039;view.htm&#039;, $data); <br/><br/>?&gt;<br/><br/>八：文章添加实现和模板处理（万里长征的再来一步）<br/><br/>&#8212;&#8212;&#8212;&#8212;&#8212;new.htm&#8212;&#8212;&#8212;&#8211;<br/>&lt;form action=&quot;add.php&quot; method=&quot;post&quot;&gt;<br/>标题:&lt;input type=&quot;text&quot; size=&quot;20&quot;&gt;&lt;br&gt;<br/>内容:&lt;textarea cols=&quot;50&quot; rows=&quot;4&quot;&gt;&lt;/textarea&gt;&lt;br&gt;<br/>&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;input type=&quot;submit&quot; value=&quot;提交&quot;&gt;<br/>&lt;/form&gt;<br/><br/><br/>&#8212;&#8212;&#8212;&#8212;&#8212;new.php&#8212;&#8212;&#8212;&#8212;<br/>&lt;?php <br/><br/>require_once &quot;config.inc.php&quot;; <br/><br/>renderTpl(&#039;new.htm&#039;, array()); <br/><br/>?&gt; <br/><br/><br/><br/>&#8212;&#8212;&#8212;&#8212;&#8212;CoreUtil.php&#8212;&#8212;&#8212;&#8212;&#8211;<br/>&lt;?php <br/><br/>function doPostVar(&amp;$data){ <br/> &nbsp; &nbsp;$keys = array_keys($data); <br/> &nbsp; &nbsp;foreach($keys as $key){ <br/> &nbsp; &nbsp; &nbsp; &nbsp;$data[$key] = addslashes(htmlspecialchars(trim($data[$key]))); <br/> &nbsp; &nbsp; &nbsp; &nbsp;if($data[$key]==null) $data[$key] = &quot;$key default&quot;; <br/> &nbsp; &nbsp;} <br/>} <br/>?&gt; <br/><br/><br/>&#8212;&#8212;&#8212;&#8212;&#8212;add.htm&#8212;&#8212;&#8212;&#8212;<br/>&lt;!&#8211; BEGIN success &#8211;&gt;<br/>{content}<br/>&lt;!&#8211; END success &#8211;&gt;<br/><br/><br/>&#8212;&#8212;&#8212;&#8212;&#8212;add.php&#8212;&#8212;&#8212;&#8212;<br/>&lt;?php <br/><br/>require_once &quot;config.inc.php&quot;; <br/><br/>dbConnect(); <br/>$data = action(); <br/>doPostVar($data); <br/>addArticle($data); <br/>$result[success][content] = &quot;文章添加成功&quot;; <br/>dbDisconnect(); <br/><br/>renderTpl(&#039;add.htm&#039;, $result); <br/><br/>function action(){ <br/> &nbsp; &nbsp;$data = array(); <br/> &nbsp; &nbsp;$data[title] = $_POST[title]; <br/> &nbsp; &nbsp;$data[content] = $_POST[content]; <br/> &nbsp; &nbsp;$data[datetime] = date(&#039;Y-m-d H:i:s&#039;); <br/> &nbsp; &nbsp;$data[pid] = 1; <br/> &nbsp; &nbsp;return $data; <br/>} <br/><br/>?&gt; <br/><br/>这样一个最最简单的文章的发布系统就完成了，不知道对您有什么收获没有。<br/><br/>九、总结<br/><br/><br/>程序写完了，大家来总结一下吧，看看实现过程，应该可以说是简单明了吧。<br/>1、统一实现数据库访问接口。更改后台数据库结构的时候，只要简单的修改相应的接口函数，其他部分的php代码根本就不用理会。<br/>2、整个系统php代码和html代码分开管理，php代码前台实现起来也很简单，你也应该已经可以发现了，基本上是在10行代码左右。<br/>3、可以任意的扩充功能。用函数对新的功能进行包装后，在具体的前台的查询显示页面中只有加入对相应的函数的简单的调用就可以了，一行代码就搞定了。<br/>4、代码复用。通过对功能的包装，减少了大量的不必要的重复代码工作，效率应该是提高了很多吧？<br/>5、可以移植性。如果将来做其他的网站，要是遇到了和这个项目相同的实现功能，你可以怎么做呢？把这里的函数和数据库结构copy过去，修改一下新项目的模板，是不是就可一完成这个新的项目了呢？根本就不用考虑修改php代码。<br/>6、结构代码清晰。别人可以轻易的和你共同开发一个项目，代码冲突也会减少至最低。<br/><br/>当然实际工作中遇到的情况可能比这个例子复杂的多，但是再复杂的任务都是可以拆分的。<br/><br/><br/>十、后言<br/><br/>不知道大家有没有学过jsp和servlet这样的东西，他们有很多优秀的设计思路，值得我们去研究和copy（说句实在话，有时间的都应该去接触一下java，不是为了学习这门语言而学习，是要学习他的设计模式和优秀的功能实现方式）。jsp至少有两样东西对我们很有用，action和filter。<br/><br/>action是主要是处理一些事件逻辑，就像add.php中我们定义的action()函数一样，用来验证和获取表单提交上来的数据。当然这样写的代码量和你以前方法的代码量是一样的，好像没有什么区别，但是它实现了代码的分离，结构是不是比你以前的方法清晰很多呢？<br/><br/>filter是一个过滤功能，用来过滤和重新定向网络的访问，对一些非法的请求和错误的请求进行重新的定向。让我们来通过一个后台管理的程序来看看他具体的作用。<br/><br/><br/>将下面的这个函数copy到你的CoreUtil.php里面，这个函数是一个后台管理登陆的过滤函数，一个是不在本地缓存web页面的函数：<br/><br/>function windowNoCache($cache){ <br/> &nbsp; &nbsp;if(!$cache &#124;&#124; headers_sent()) return ; <br/> &nbsp; &nbsp;header(&#039;Expires: &#039;.date(&#039;D,d M Y H:i:s&#039;,mktime(0,0,0,1,1,2000)).&#039; GMT&#039;); <br/> &nbsp; &nbsp;header(&#039;Last-Modified:&#039;.gmdate(&#039;D,d M Y H:i:s&#039;).&#039; GMT&#039;); <br/> &nbsp; &nbsp;header(&#039;Cache-control: private, no-cache,must-revalidate&#039;); <br/> &nbsp; &nbsp;header(&#039;Pragma: no-cache&#039;); <br/>} <br/>function isAdminLogin(){ <br/> &nbsp; &nbsp;if($_SESSION[relogin]==&quot;ok&quot;) return; <br/> &nbsp; &nbsp;if($_SESSION[adminuser]!=SYS_ADMIN_NAME){ <br/> &nbsp; &nbsp; &nbsp; &nbsp;$_SESSION[relogin] = &quot;ok&quot;; <br/> &nbsp; &nbsp; &nbsp; &nbsp;die(&quot;&lt;script language=&#92;&quot;javascript&#92;&quot;&gt; top.location=&#039;adminlogin.php&#039;; &lt;/script&gt;&quot;); <br/> &nbsp; &nbsp;} <br/> &nbsp; &nbsp;$_SESSION[relogin] = &quot;no&quot;; <br/>} <br/><br/>然后在 根目录 底下加上如下的文件<br/>&#8212;&#8212;&#8212;&#8212;adminconfig.inc.php&#8212;&#8212;&#8212;&#8212;<br/>&lt;?php <br/><br/>define(&#039;SYS_ADMIN_NAME&#039;, &#039;hello&#039;); //后台管理登陆名 <br/>define(&#039;SYS_ADMIN_PASSWORD&#039;, &#039;hello&#039;); //后台管理登陆密码 <br/>include &#039;config.inc.php&#039;; <br/>windowNoCache(true); <br/>isAdminLogin(); <br/><br/>?&gt; <br/><br/><br/><br/>&#8212;&#8212;&#8212;&#8212;adminindex.php&#8212;&#8212;&#8212;&#8212;&#8212;-<br/>&lt;?php <br/><br/>require_once &quot;adminconfig.inc.php&quot;; <br/><br/>renderTpl(&#039;adminindex.htm&#039;, array()); <br/><br/>?&gt; <br/><br/><br/><br/>&#8212;&#8212;&#8212;&#8212;adminlogin.php&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br/>&lt;?php <br/><br/>include &quot;adminconfig.inc.php&quot;; <br/><br/>if($_POST[name]==SYS_ADMIN_NAME &amp;&amp; $_POST[code]==SYS_ADMIN_PASSWORD){ <br/> &nbsp; &nbsp;$_SESSION[adminuser] = SYS_ADMIN_NAME; <br/> &nbsp; &nbsp;header(&quot;location: adminindex.php&quot;); <br/>}else{ <br/> &nbsp; &nbsp;renderTpl(&#039;adminlogin.htm&#039;, array()); <br/>} <br/><br/>?&gt; <br/><br/><br/>在 smart/template 目录下面加上如下的文件<br/>------------adminlogin.htm------------------<br/>&lt;form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot;&gt;<br/>&lt;input type=&quot;text&quot; name=&quot;name&quot; size=&quot;20&quot; value=&quot;&quot;&gt;<br/>&lt;input type=&quot;password&quot; name=&quot;code&quot; size=&quot;20&quot; value=&quot;&quot;&gt;<br/>&lt;input type=&quot;submit&quot; name=&quot;Submit&quot; value=&quot; 登 陆 &quot;&gt;<br/>&lt;/form&gt;<br/><br/><br/>------------adminindex.htm----------------<br/>&lt;h2&gt;您好欢迎登陆后台管理&lt;/h2&gt;<br/><br/>现在访问adminindex.php看看会发生什么事情，然后用adminconfig.inc.php里面设定的用户名密码登陆。这种功能在web的很多地方都可以派上用场，应该是一个好的方法吧。其他的后台访问的页面只要也都加载了adminconfig.inc.php ，就不用再考虑后台访问权限的问题了。<br/><br/><br/>十一 附录<br/><br/>简单的隐藏文件的扩展名,搞晕浏览者，让他不知道你是用什么语言编的程序。<br/><br/>就以list1.php为例子吧，<br/><br/>1、我们修改list1.php的名称为list1.tmp<br/>2、进入命令行窗口（dos窗口），在web的目录下面建立一个文件，文件名是“.htaccess”。<br/>3、编辑“.htaccess”文件，输入以下的内容<br/><br/>AddType application/x-httpd-php .tmp<br/><br/>通过浏览器访问list1.tmp，看看是不是ok了。<br/><br/></p>
<h2  class="related_post_title">相关博文</h2><ul class="related_post"><li>2006年12月11日 -- <a href="http://www.5bay.cn/network-programming/php/phpweb%E5%BA%94%E7%94%A8%E7%A8%8B%E5%BA%8F%E5%BC%80%E5%8F%91%EF%BC%9A%E4%BD%BF%E7%94%A8%E6%A8%A1%E6%9D%BF.html" title="PHP-Web 应用程序开发：使用模板">PHP-Web 应用程序开发：使用模板</a> (0)</li><li>2011年06月29日 -- <a href="http://www.5bay.cn/me/kaiyuanruanjiandeyinglimoshi.html" title="开源软件的盈利模式">开源软件的盈利模式</a> (0)</li><li>2010年08月17日 -- <a href="http://www.5bay.cn/server-building/nginxxiansu.html" title="Nginx限速">Nginx限速</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/eeeeeeee-2.html" title="防止网卡被禁用的具体配置方法">防止网卡被禁用的具体配置方法</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/aoeempirebakeebshell.html" title="帝国备份王(Empirebak)拿webshell">帝国备份王(Empirebak)拿webshell</a> (0)</li><li>2010年07月28日 -- <a href="http://www.5bay.cn/server-building/ep.html" title="让IIS只监听指定IP">让IIS只监听指定IP</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/eeeeeeee.html" title="最令PHP初学者头痛的十四个问题">最令PHP初学者头痛的十四个问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeecketee.html" title="PHP和Socket简介">PHP和Socket简介</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeefangeredoc.html" title="php的文档句法(heredoc)<<<和PHP字符串操作">php的文档句法(heredoc)<<<和PHP字符串操作</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/peeeeee.html" title="深入探讨PHP中的内存管理问题">深入探讨PHP中的内存管理问题</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeeeeeeeehuai.html" title="PHP对文本数据库的基本操作方法">PHP对文本数据库的基本操作方法</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/requireeecludexi.html" title="require和include的异同">require和include的异同</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeeeeee-3.html" title="PHP生成随机字符串">PHP生成随机字符串</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeezhanchang.html" title="PHP安全之数据过滤">PHP安全之数据过滤</a> (0)</li><li>2010年07月26日 -- <a href="http://www.5bay.cn/network-programming/phpeeee.html" title="PHP代码安全点滴">PHP代码安全点滴</a> (0)</li></ul>
	标签Tags：<a href="http://www.5bay.cn/category/network-programming/php" title="PHP" rel="tag">PHP</a>, <a href="http://www.5bay.cn/tag/php" title="PHP" rel="tag">PHP</a>, <a href="http://www.5bay.cn/tag/%E5%BC%80%E5%8F%91%E6%A8%A1%E5%BC%8F" title="开发模式" rel="tag">开发模式</a>, <a href="http://www.5bay.cn/tag/%E6%A8%A1%E6%9D%BF" title="模板" rel="tag">模板</a><br />
]]></content:encoded>
			<wfw:commentRss>http://www.5bay.cn/network-programming/php/%E5%88%9B%E9%80%A0%E4%B8%96%E7%95%8C%E4%B8%8A%E6%9C%80%E7%AE%80%E5%8D%95%E7%9A%84php%E5%BC%80%E5%8F%91%E6%A8%A1%E5%BC%8F.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

