<?xml version="1.0" encoding="UTF-8" ?>















<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

<channel>
<title><![CDATA[KFC]]> </title>
<description>
<![CDATA[肯德鸡的味道]]>
</description>
<link>http://kfc.blog.bokee.net/</link>
<language>zh-cn</language>
<creator>kfc</creator>
<pubDate>Tue, 24 Jan 2006 17:25:46 GMT+08:00 </pubDate>
<generatorAgent rdf:resource="http://www.bokee.net"/>
<ttl>5</ttl>

<item>
<title>mysql 升级 Client does not support authentication protocol requested by server;</title>
<link>http://www.bokee.net/blogmodule/weblogcomment_viewEntry/866220.html</link>
<description>
<![CDATA[<div twffan="done">Client does not support authentication protocol requested by server;<br />所有安装Mysql4.1以上版本的用户请看本条!!!!!!!!!</div>
<div twffan="done"><br />Mysql 4.1及以上版本使用了新的密码算法,而PHP不支持新算法,因此在新增用户后,还需要用下面的方法解决PHP无法连接登录Mysql的问题:&nbsp; (其中some_user,some_host,newpwd分别是您数据库的用户名,主机,密码)</div>
<div twffan="done">[b]第一种解决方法:[/b]<br />mysql&gt; SET PASSWORD FOR<br />&nbsp;&nbsp;&nbsp; -&gt; <a href="mailto:'some_user'@'some_host'"><font color="#0066a7">'some_user'@'some_host'</font></a> = OLD_PASSWORD('newpwd');</div>
<div twffan="done">比方说数据库用户是admin,主机localhost，密码是123456</div>
<div twffan="done">这时候输入的命令应该是：</div>
<div twffan="done">mysql&gt; SET PASSWORD FOR <a href="mailto:admin@localhost=OLD_PASSWORD('123456'"><font color="#0066a7">admin@localhost=OLD_PASSWORD('123456'</font></a>);<br />[感谢henrykim做的这个例子]</div>
<div twffan="done">第二种解决方法:</div>
<div twffan="done">mysql&gt; UPDATE mysql.user SET Password = OLD_PASSWORD('newpwd')<br />&nbsp;&nbsp;&nbsp; -&gt; WHERE Host = 'some_host' AND User = 'some_user';<br />mysql&gt; FLUSH PRIVILEGES;</div>
<div twffan="done"><br />第三种解决方法(不推荐)</div>
<div twffan="done">用 --old-passwords 选项启用 mysqld,然后用上面的方法更改原有用户</div>
<div twffan="done">摘自Mysql官方网站: <a href="http://dev.mysql.com/doc/mysql/en/old-client.html"><font color="#0066a7">http://dev.mysql.com/doc/mysql/en/old-client.html</font></a></div>]]>
</description>
<guid isPermaLink="false">http://www.bokee.net/blogmodule/weblogcomment_viewEntry/866220.html</guid>
<subject>PHP,Apache,Mysql</subject>
<author>kfc</author>
<category>PHP,Apache,Mysql</category>
<pubDate>Fri, 13 Jul 2007 16:42:02 GMT+08:00 </pubDate>
</item>

<item>
<title>从一个疯狂下载者变成一个学习者 节选</title>
<link>http://www.bokee.net/blogmodule/weblogcomment_viewEntry/773113.html</link>
<description>
<![CDATA[<p>这世界上没有免费的午餐，这句话是一点都不错，当我们为下载了几G和几十G的免费英语资料而沾沾自喜的时候，当我们不停的去寻找更多的资料的时候，我们已经失去了最宝贵的东西，那就是时间，那就是生命，人生能有几回搏？我们浪费掉一个小时，我们的生命中就失去一个。本来我们一生中就做很多无意义的事浪费时间了，那么学习上就不要再浪费了，多去下点苦工夫认真背点东西也比在下载中自我陶醉有意义的多。语言的学习没有新旧资料之分，只要不是中古语言，对于我们来说看好哪一个教材和课本就坚持学下去，都会通往攻克英语的山峰的。只有去下工夫一个一个字，一个一个句子的去掌握，才会有收获，英语学习是没有捷径的。在这里也希望网上这些搞下载的网站能够清醒认识到这一点，不要耽误自己和别人，有利可图那就另当别论，但那些为大家无私奉献的网站的斑竹们，感谢他们的付出，但希望头脑都能清醒一些，把浮躁的心压下来，大家在一起多交流一下心得，多多做一些既提高自己又帮助别人的工作，一起学习，而不是把大堆的资料拿出来搬回去。</p>
<p>掌握科学的学习方法，风雨无阻，有勇气和毅力，相信自己&quot;我行我一定能做到&quot;,把自己真正的&ldquo;从一个疯狂下载者变成一个学习者&rdquo;，那么你也一定会再雄心勃勃。</p>]]>
</description>
<guid isPermaLink="false">http://www.bokee.net/blogmodule/weblogcomment_viewEntry/773113.html</guid>
<subject>杂记</subject>
<author>kfc</author>
<category>杂记</category>
<pubDate>Fri, 01 Jun 2007 20:07:38 GMT+08:00 </pubDate>
</item>

<item>
<title>在线划词翻译查询javascript代码 </title>
<link>http://www.bokee.net/blogmodule/weblogcomment_viewEntry/773106.html</link>
<description>
<![CDATA[任何网站只要将以下代码放入您的网页就可以为您的站点添加划词翻译的功能<br />&lt;script src=&quot;<a href="http://dict.cn/hc/">http://dict.cn/hc/</a>&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;<br />&lt;script type=&quot;text/javascript&quot;&gt;<br />dictInit();<br />&lt;/script&gt;]]>
</description>
<guid isPermaLink="false">http://www.bokee.net/blogmodule/weblogcomment_viewEntry/773106.html</guid>
<subject>html</subject>
<author>kfc</author>
<category>html</category>
<pubDate>Fri, 01 Jun 2007 20:03:57 GMT+08:00 </pubDate>
</item>

<item>
<title>典型的三行二列居中高度自适应布局</title>
<link>http://www.bokee.net/blogmodule/weblogcomment_viewEntry/772457.html</link>
<description>
<![CDATA[<p>如何使整个页面内容居中，如何使高度适应内容自动伸缩。这是学习CSS布局最常见的问题。下面就给出一个实际的例子，并详细解释。（本文的经验和是蓝色理想论坛xpoint、guoshuang共同讨论得出的。）</p>
<p>首先先按这里看实际运行效果，这个页面在mozilla、opera和IE浏览器中均可以实现居中和高度自适应。我们来分析代码：</p>
<p>完整代码<br />&lt;html&gt;<br />&lt;head&gt;<br />&lt;style type=&quot;text/css&quot;&gt;<br />body{<br />background:#999;<br />text-align:center;<br />color: #333;<br />font-family:arial,verdana,sans-serif;<br />}<br />#header{<br />width:776px;<br />margin-right: auto;<br />margin-left: auto; <br />padding: 0px;<br />background: #EEE;<br />height:60px;<br />text-align:left;<br />} #contain{<br />margin-right: auto;<br />margin-left: auto;<br />width: 776px;<br />} #mainbg{<br />width:776px;<br />padding: 0px;<br />background: #60A179;<br />float: left;<br />}<br />#right{<br />float: right; <br />margin: 2px 0px 2px 0px;<br />padding:0px; <br />width: 574px; <br />background: #ccd2de;<br />text-align:left;<br />}<br />#left{<br />float: left; <br />margin: 2px 2px 0px 0px; <br />padding: 0px; <br />background: #F2F3F7;<br />width: 200px;<br />text-align:left;<br />}<br />#footer{<br />clear:both;<br />width:776px;<br />margin-right: auto;<br />margin-left: auto; <br />padding: 0px;<br />background: #EEE;<br />height:60px;}<br />.text{margin:0px;padding:20px;}<br />&lt;/style&gt;<br />&lt;/head&gt;<br />&lt;body&gt;<br />&lt;div id=&quot;header&quot;&gt;header&lt;/div&gt;<br />&lt;div id=&quot;contain&quot;&gt;<br />&lt;div id=&quot;mainbg&quot;&gt;<br />&lt;div id=&quot;right&quot;&gt;<br />&lt;div <br />class=&quot;text&quot;&gt;right&lt;p&gt;1&lt;/p&gt;&lt;p&gt;1&lt;/p&gt;&lt;p&gt;1&lt;/p&gt;&lt;p&gt;1&lt;/p&gt;&lt;p&gt;1&lt;/p&gt;&lt;/div&gt;<br />&lt;/div&gt;<br />&lt;div id=&quot;left&quot;&gt;<br />&lt;div class=&quot;text&quot;&gt;left&lt;/div&gt;<br />&lt;/div&gt;<br />&lt;/div&gt;<br />&lt;/div&gt;<br />&lt;div id=&quot;footer&quot;&gt;footer&lt;/div&gt;<br />&lt;/body&gt;<br />&lt;/html&gt;</p>
<p>代码分析<br />&nbsp;<br />首先我们定义body和顶部第一行#header，这里面的关键是body中的text-align:center;和header中的margin-right: auto;margin-left: auto;，通过这两句使得header居中。注：其实定义text-align:center;就已经在IE中实现居中，但在mozilla中无效，需要设置margin:auto;才可以实现mozilla中的居中。</p>
<p>接下来定义中间的两列#right和#left。为了使中间两列也居中，我们在它们外面嵌套一个层#contain，并对contain设置margin:auto;，这样#right和#left就自然居中了。</p>
<p>注意中间两列定义的顺序，我们首先定义#right，通过float: right;让它浮在#contain层的最右边。然后再定义#left，通过float: left;让它浮动在#right层的左面。这和我们以前表格从左到右定义的顺序正好相反。</p>
<p>我们看到代码中在#contain和两列之间还嵌套了一个层#mainbg，这个层是做什么用的呢？这个层就是用来定义#contain的背景的。你肯定会问，为什么不直接在#contain中定义背景，而要多套一层呢？那是因为在#contain中直接定义的背景，在mozilla中将显示不出来，必须定义高度值才可以。如果定义了高度值，#right层就无法实现根据内容的自动伸缩。为了解决背景和高度问题，就必须增加这么一个#mainbg层。窍门在于#mainbh这个层定义float: left;，因为float使层自动有宽和高的属性。(暂且这么理解：)</p>
<p>最后是定义底部的#footer层。这个定义的关键是：clear:both;，这一句话的作用是取消#footer层的浮动继承。否则的话，你会看到#footer紧贴着#header显示，而不是在#right的下面。</p>
<p>主要的层定义完毕，这个布局就ok了。补充一点：你看到我还定义了一个.text{margin:0px;padding:20px;}，这个class的作用是使内容的外围有20px的空白。为什么不直接在#right里定义margin或者padding呢，因为mozilla和IE对css盒模型的解释不一致，直接定义margin/padding会造成mozilla里布局变形。我一般采用内部再套一层的做法来解决。</p>
<p>希望这个布局对你有帮助，有什么问题欢迎到论坛交流。<br />&nbsp;<br />原文地址 <a href="http://blog.csdn.net/dhz123/archive/2004/10/27/153913.aspx">http://blog.csdn.net/dhz123/archive/2004/10/27/153913.aspx</a>&nbsp; </p>]]>
</description>
<guid isPermaLink="false">http://www.bokee.net/blogmodule/weblogcomment_viewEntry/772457.html</guid>
<subject>html</subject>
<author>kfc</author>
<category>html</category>
<pubDate>Fri, 01 Jun 2007 14:49:15 GMT+08:00 </pubDate>
</item>

<item>
<title>Apache 实现禁止图片盗链</title>
<link>http://www.bokee.net/blogmodule/weblogcomment_viewEntry/772454.html</link>
<description>
<![CDATA[<p>在其它论坛上看到的.虽然文档里有记录,但还是收录它.方便我以后查询<br />1、假设充许连结图片的主机域名为：<a href="http://www.phpNet.cn">www.phpNet.cn</a> <br />2、修改httpd.conf</p>
<p>SetEnvIfNoCase Referer &quot;^http://www.phpnet.cn/&quot; local_ref=1 <br />&lt;FilesMatch &quot;.(gif|jpg)&quot;&gt; <br />Order Allow,Deny <br />Allow from env=local_ref <br />&lt;/FilesMatch&gt;&nbsp; </p>
<p><br />这个简单的应用不光可以解决图片盗链的问题，稍加修改还可以防止任意文件盗链下载的问题。 <br />使用以上的方法当从非指定的主机连结图片时，图片将无法显示，如果希望显示一张&ldquo;禁止盗链&rdquo;的图片，我们可以用mod_rewrite 来实现。 <br />首先在安装 apache 时要加上 --enable-rewrite 参数加载 mod_rewrite 模组。 <br />假设&ldquo;禁止盗链&rdquo;的图片为abc.gif，我们在 httpd.conf 中可以这样配置：</p>
<p>RewriteEngine on <br />RewriteCond %{HTTP_REFERER} !^$ <br />RewriteCond %{HTTP_REFERER} !^http://(www\.)?phpnet.cn /.*$ [NC] <br />RewriteRule \.(gif|jpg)$ <a href="http://www.phpnet.cn/abc.gif">http://www.phpnet.cn/abc.gif</a> [R,L]&nbsp; </p>
<p><br />当主机的图片被盗链时，只会看到 abc.gif 这张&ldquo;禁止盗链&rdquo;的图片！</p>]]>
</description>
<guid isPermaLink="false">http://www.bokee.net/blogmodule/weblogcomment_viewEntry/772454.html</guid>
<subject>PHP,Apache,Mysql</subject>
<author>kfc</author>
<category>PHP,Apache,Mysql</category>
<pubDate>Fri, 01 Jun 2007 14:47:57 GMT+08:00 </pubDate>
</item>

</channel>
</rss>