<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet href='http://feed.feedsky.com/styles/temp01.xsl' type='text/xsl' ?><!--这是一个由Feedsy提供技术支持的Feed，为了提高读者阅读的体验，以及满足用户美化自己Feed的需要，我们设计了多种精美的Feed模板，提供给大家选择，所有最终呈现出来的样式，皆由用户自愿选择使用，未经许可，任何团体和个人，请不要擅自修改样式或者盗用，这是对于用户选择权的尊重。--><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:fs="http://www.feedsky.com/namespace/feed" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:link href="http://feed.feedsky.com/61dev" type="application/rss+xml" rel="self"></atom:link><fs:self_link href="http://feed.feedsky.com/61dev" type="application/rss+xml"></fs:self_link><lastBuildDate>Mon, 18 Jan 2010 02:11:00 GMT</lastBuildDate><title>网站开发日志</title><description>本博客用于记录网站开发的点点滴滴。包括网站设计，编程指南，资源和灵感。本站的文章大都是原创或者翻译作品。我并不反对转载，因为互联网本来就是用来共享资源的。但是当你引用我的文章时，请注明出处。谢谢！</description><image><url>http://www.feedsky.com/feed/61dev/sc/gif</url><title>网站开发日志</title><link>http://www.61dh.com/blog/</link></image><link>http://www.61dh.com/blog/</link><atom:id>tag:blogger.com,1999:blog-3563865031762309282</atom:id><openSearch:totalResults>170</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><pubDate>Tue, 19 Jan 2010 00:35:19 GMT</pubDate><dc:creator>noreply@blogger.com (D Cai)</dc:creator><item><title>phpwind的几个问题</title><link>http://item.feedsky.com/~feedsky/61dev/~7212679/323350926/5321839/1/item.html</link><thr:total>0</thr:total><description>&lt;p&gt;最近给&amp;quot;彩票站&amp;quot;搞了一个论坛，之前没有接触过任何论坛软件。有听说过PHPWIND和DISCUZ！，上网搜索了下，据说PHPWIND速度会快一点。&amp;quot;彩票站&amp;quot;资源有限，就装了PHPWIND。速度还行，没有比较，我也不敢说谁快谁慢。但是，在使用phpwind的过程里，还是碰到了一些问题。&lt;/p&gt;  &lt;p&gt;1. PHPWIND建议安装后，把admin.php改名，这样会比较安全一点。于是我就改了，改好一切正常，但是发现论坛顶部的&amp;quot;系统设置&amp;quot;还是指向默认的链接 - admin.php. &lt;/p&gt;  &lt;p&gt;2. 论坛的面包屑导航的顶层，也就是指向论坛首页的链接不会自动使用论坛名称命名，而是使用PHPWind。我在后台面板上找了很久就是找不到相关设置。&lt;/p&gt;  &lt;p&gt;3. 后台的面包屑导航，只是告诉你当前位置，而不是使用实际链接，虽然它告诉你当前页的上一层是什么，但是却无法直接点入。&lt;/p&gt;  &lt;p&gt;最后我是在源代码里，找到前两个问题的答案。&lt;/p&gt;  &lt;p&gt;修改config.php，位置：/data/bbscache/config.php。&lt;/p&gt;  &lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$db_adminfile='admin.php';  &lt;span style=&quot;color: #008000&quot;&gt;//这个设置控制'系统设置'的href&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$db_bbsname='PHPWind'; &lt;span style=&quot;color: #008000&quot;&gt;//这个设置控制面包屑的顶层链接名，你可以把它改为你的论坛名称&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;&amp;#160;&lt;strong&gt;更正：只修改這個文件是不夠的，因為它只是cache(緩存)。實際上應該在數據庫修改。打開PHPMYADMIN，表的名稱為：pw_config. 修改&lt;/strong&gt;db_adminfile 和 db_bbsname即可。&lt;/p&gt;

&lt;p&gt;總的來說，phpwind对论坛版块管理/帖子管理等还是很不错的。&lt;/p&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3563865031762309282-8585187129886463577?l=www.61dh.com%2Fblog' alt='' /&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/323350926/61dev/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/61dev/~7212679/323350926/5321839/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/61dev/323350926/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/61dev/323350926/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category domain="http://www.blogger.com/atom/ns#">编程开发</category><pubDate>Mon, 18 Jan 2010 10:11:00 +0800</pubDate><author>noreply@blogger.com (D Cai)</author><guid isPermaLink="false">tag:blogger.com,1999:blog-3563865031762309282.post-8585187129886463577</guid><dc:creator>noreply@blogger.com (D Cai)</dc:creator><fs:srclink>http://www.61dh.com/blog/2010/01/phpwind.html</fs:srclink><fs:srcfeed>http://www.61dh.com/blog/rss.xml</fs:srcfeed><fs:itemid>feedsky/61dev/~7212679/323350926/5321839</fs:itemid></item><item><title>Google自定义搜索引擎 - 宽度设置</title><link>http://item.feedsky.com/~feedsky/61dev/~7212679/323350927/5321839/1/item.html</link><thr:total>0</thr:total><description>&lt;p&gt;今天在给另一个网站加入Google的自定义搜索引擎时，碰到一个问题。我选择在自己的网站上显示搜索结果，就是像“网站开发日志”现在用的一样。很明显这是通过iframe来实现的，但是在使用Google自定义搜索引擎自动生成器里，这个搜索结果的iframe宽度必须大于795，我想这是考虑到广告可以被放置在搜寻结果页面的右边。&lt;/p&gt;  &lt;p&gt;自动生成器不让设置，就直接改代码喽。记得以前在给“网站开发日志”加Google自定义搜索引擎时，我就是这么做的。如下：&lt;/p&gt;  &lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&amp;lt;script type=&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;text/javascript&lt;/span&gt;&amp;quot;&amp;gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; googleSearchIframeName = &amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;cse-search-results&lt;/span&gt;&amp;quot;;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; googleSearchFormName = &amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;cse-search-box&lt;/span&gt;&amp;quot;;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; googleSearchFrameWidth = 775; &lt;span style=&quot;color: #008000&quot;&gt;//把它改为适合你的页面布局的尺寸&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; googleSearchDomain = &amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;www.google.com.tw&lt;/span&gt;&amp;quot;;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  &lt;span style=&quot;color: #0000ff&quot;&gt;var&lt;/span&gt; googleSearchPath = &amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;/cse&lt;/span&gt;&amp;quot;;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;但是发现，这么做并不行。Google在生成搜索页面的时候，仍然用795周围iframe的宽度。&lt;/p&gt;

&lt;p&gt;后来发现搜索框代码里还有一个参数可以修改，那就是cof值:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;FORID:10 - 支持最小iframe宽度为795&lt;/li&gt;

  &lt;li&gt;FORID:11 - 支持最小iframe宽度为500&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;呵呵，把cof的值改为FORID:11后问题解决了。&lt;/p&gt;

&lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;    &amp;lt;input type=&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;hidden&lt;/span&gt;&amp;quot; &lt;span style=&quot;color: #0000ff&quot;&gt;name&lt;/span&gt;=&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;cof&lt;/span&gt;&amp;quot; value=&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;FORID:11&lt;/span&gt;&amp;quot; /&amp;gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;    &amp;lt;input type=&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;hidden&lt;/span&gt;&amp;quot; &lt;span style=&quot;color: #0000ff&quot;&gt;name&lt;/span&gt;=&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;ie&lt;/span&gt;&amp;quot; value=&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;UTF-8&lt;/span&gt;&amp;quot; /&amp;gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;    &amp;lt;input type=&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;text&lt;/span&gt;&amp;quot; &lt;span style=&quot;color: #0000ff&quot;&gt;name&lt;/span&gt;=&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;q&lt;/span&gt;&amp;quot; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt;=&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;keyword&lt;/span&gt;&amp;quot; /&amp;gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;此外，你如果用IE，你可能也发现了，Google AdSense的&lt;a href=&quot;http://www.61dh.com/blog/2009/11/blog-post.html&quot; target=&quot;_blank&quot;&gt;网页上有一些非安全元素&lt;/a&gt;，所以经常会有弹出窗口警告你“改页面含有非安全元素，你想显示它们吗...”。看来Google AdSense的广告设置功能还有待提高.&lt;/p&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3563865031762309282-7155254288015079568?l=www.61dh.com%2Fblog' alt='' /&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/323350927/61dev/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/61dev/~7212679/323350927/5321839/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/61dev/323350927/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/61dev/323350927/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category domain="http://www.blogger.com/atom/ns#">编程开发</category><pubDate>Sun, 27 Dec 2009 12:08:00 +0800</pubDate><author>noreply@blogger.com (D Cai)</author><guid isPermaLink="false">tag:blogger.com,1999:blog-3563865031762309282.post-7155254288015079568</guid><dc:creator>noreply@blogger.com (D Cai)</dc:creator><fs:srclink>http://www.61dh.com/blog/2009/12/google.html</fs:srclink><fs:srcfeed>http://www.61dh.com/blog/rss.xml</fs:srcfeed><fs:itemid>feedsky/61dev/~7212679/323350927/5321839</fs:itemid></item><item><title>我的Eclipse笔记</title><link>http://item.feedsky.com/~feedsky/61dev/~7212679/323350928/5321839/1/item.html</link><thr:total>0</thr:total><description>&lt;p&gt;最近在用Eclipse，觉得越用越好用。之前在日志里提到NetBEAN，之所以放弃它是因为觉得它很慢。在写代码的时候，它会自动扫描你的项目文件夹，然后提供提示，例如你输入ab，而你在库里已经定义了函数叫abc，它会帮你找出来。好像是一个很不错的功能，但是问题是当你的项目文件夹过大，它的反应会变得很迟钝。你敲个ab它就僵住了，过了很久才给你出个abc。上网搜索了，没有查到解决方案。之前之所以没有选择Eclipse，是因为以为它不可以直接导入已有的源代码，或者说在原有的代码上建立新的项目。后来发现我错了，Eclipse的确包含这个功能(至少在我用的版本里)。另外还有一个功能NetBean自带的但是Eclipse没有，那就是FTP的功能。但是在Eclipse下FTP的功能可以通过安全第三方插件来实现。&lt;/p&gt;  &lt;p&gt;和上篇关于&lt;a href=&quot;http://www.61dh.com/blog/2009/11/wamp.html&quot; target=&quot;_blank&quot;&gt;WAMP&lt;/a&gt;的文章一样，这篇文章只是本人学习使用Eclipse的笔记，所以没有准备提供很详细的介绍。估计Google一下就知道了，我自己也是Google学来的。&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;1. 那里下载？&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt; 如果你和我一样打算用Eclipse来开发PHP项目，那么建议到zend下载&lt;a href=&quot;http://www.zend.com/community/pdt&quot; target=&quot;_blank&quot;&gt;Eclipse PDT All-in-one&lt;/a&gt;。我选择的是Windows版本，直接链接在&lt;a href=&quot;http://downloads.zend.com/pdt/all-in-one/zend-eclipse-php-galileo-SR1-win32-x86.zip&quot; target=&quot;_blank&quot;&gt;这里&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;2. 如何建立新项目？&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;打开Eclipse. File-&amp;gt;New-&amp;gt;PHP Project-&amp;gt;Create new project from existing source (在原有代码基础上建立项目)&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;3. 如何安装第三方插件？&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;打开Eclipse. Help-&amp;gt; Install New Software 然后添加第三方插件网站，选择插件名。&lt;/p&gt;  &lt;p&gt;通常你可以先Google你要的功能，然后找到插件的网站，通常他们提供Elipse按转接口，然后你就可以通过上面的步骤安装了。&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;4. 我安装的插件&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;a. Elipse自带CVS版本控制系统，但是如果你要用到别的版本操作系统，你必须安装插件。比如我就装了Subclipse用来和Subversion服务器同步我的项目源码。&lt;/p&gt;  &lt;p&gt;b. Aptana 功能很多，我目前用到哦只是它的FTP功能。&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;5. 两个小技巧&lt;/strong&gt; &lt;/p&gt;  &lt;p&gt;a. Eclipse支持列操作的！ shift+alt+a&lt;/p&gt;  &lt;p&gt;b. Eclipse Explorer默认下不识别隐含文件。如果你要查看隐含文件，比如.htaccess， 你可以点击PHP Explorer顶部右边的三角形小按钮 -&amp;gt; 选择filter -&amp;gt; 反选.*resources -&amp;gt; OK&lt;/p&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3563865031762309282-1668173149259862734?l=www.61dh.com%2Fblog' alt='' /&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/323350928/61dev/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/61dev/~7212679/323350928/5321839/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/61dev/323350928/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/61dev/323350928/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category domain="http://www.blogger.com/atom/ns#">编程开发</category><pubDate>Wed, 25 Nov 2009 12:19:00 +0800</pubDate><author>noreply@blogger.com (D Cai)</author><guid isPermaLink="false">tag:blogger.com,1999:blog-3563865031762309282.post-1668173149259862734</guid><dc:creator>noreply@blogger.com (D Cai)</dc:creator><fs:srclink>http://www.61dh.com/blog/2009/11/eclipse.html</fs:srclink><fs:srcfeed>http://www.61dh.com/blog/rss.xml</fs:srcfeed><fs:itemid>feedsky/61dev/~7212679/323350928/5321839</fs:itemid></item><item><title>免费虚拟主机</title><link>http://item.feedsky.com/~feedsky/61dev/~7212679/323350929/5321839/1/item.html</link><thr:total>0</thr:total><description>&lt;p&gt;刚刚开始做网站流量不大，或者是纯粹想找个空间来玩玩(学习、练手、调试)？在这种情况下，你可能和我有同感，找个免费的虚拟主机最好！&lt;/p&gt;  &lt;p&gt;之前试过一些免费的主机，要么有广告、要么上传速度限制、要么上传文件大小限制、要么国内不可访问、要么…, 而&lt;a title=&quot;注冊真正免费的虚拟主机&quot; onclick=&quot;this.href=&amp;#39;http://www.000webhost.com/227794.html&amp;#39;&quot; href=&quot;http://www.000webhost.com/&quot; target=&quot;_blank&quot;&gt;000webhost&lt;/a&gt;提供的免费虚拟主机完全没有这些限制，我用了大半年，唯一碰到的问题是他们的mysql服务器宕机了几次，但是每次都只有10分钟左右。另外值得一提的是想我们这样的免费用户，他们也同样提供客服。每次我发送一个ticket，很快就可以得到答复。真的没得说，因此想在这里和大家分享一下。&lt;/p&gt;  &lt;p&gt;先给几个参数：&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;硬盘空间： 1.5GB &lt;/li&gt;    &lt;li&gt;带宽： 100GB &lt;/li&gt;    &lt;li&gt;挂域名：没有限制 &lt;/li&gt;    &lt;li&gt;控制面板：非常好用 &lt;/li&gt;    &lt;li&gt;广告: 没有，除非你挂自己的广告 :-) &lt;/li&gt;    &lt;li&gt;PHP/PHP Mail/MYSQL/自动备份/FTP/Cron Jobs/PHP Pear Modules &lt;/li&gt;    &lt;li&gt;POP3/Web Mail/IMAP &lt;/li&gt;    &lt;li&gt;Fantastico Autoinstaller (自动安装wordpress, phpBB, Joomla, Drupal) &lt;/li&gt;    &lt;li&gt;…. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;实例：&lt;/p&gt;  &lt;p&gt;我的&lt;a href=&quot;http://www.cpzhan.com&quot; target=&quot;_blank&quot;&gt;彩票站&lt;/a&gt;网站就是挂在&lt;a title=&quot;注冊真正免费的虚拟主机&quot; onclick=&quot;this.href=&amp;#39;http://www.000webhost.com/227794.html&amp;#39;&quot; href=&quot;http://www.000webhost.com/&quot; target=&quot;_blank&quot;&gt;000webhost&lt;/a&gt;的虚拟主机上，当初花了2美元在godaddy买了cpzhan.com的域名，然后挂在&lt;a title=&quot;注冊真正免费的虚拟主机&quot; onclick=&quot;this.href=&amp;#39;http://www.000webhost.com/227794.html&amp;#39;&quot; href=&quot;http://www.000webhost.com/&quot; target=&quot;_blank&quot;&gt;000webhost&lt;/a&gt;上，基本没出什么问题。最让我惊奇的是&lt;strong&gt;国内用户竟然也可以访问&lt;/strong&gt;。&lt;/p&gt;  &lt;p&gt;另外，你注册一个Email后，&lt;a title=&quot;注冊真正免费的虚拟主机&quot; onclick=&quot;this.href=&amp;#39;http://www.000webhost.com/227794.html&amp;#39;&quot; href=&quot;http://www.000webhost.com/&quot; target=&quot;_blank&quot;&gt;000webhost&lt;/a&gt;创建无数个帐号(使用自己的域名或者他们提供的免费二级域名)。同一个email下的帐号被放在一个下拉菜单里，很容易管理。&lt;/p&gt;  &lt;p&gt;总之，功能太多了，我就不在这里一一介绍，推荐你注册一个，然后自己慢慢体验吧。&lt;/p&gt;  &lt;h3&gt;&amp;gt;&lt;a title=&quot;注冊真正免费的空间&quot; onclick=&quot;this.href=&amp;#39;http://www.000webhost.com/227794.html&amp;#39;&quot; href=&quot;http://www.000webhost.com/227794.html&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;color: red&quot;&gt;點擊這里注册免费虚拟主机&lt;/span&gt;&lt;/a&gt;&lt;/h3&gt;  &lt;p&gt;最后要提的是&lt;a title=&quot;注冊真正免费的虚拟主机&quot; onclick=&quot;this.href=&amp;#39;http://www.000webhost.com/227794.html&amp;#39;&quot; href=&quot;http://www.000webhost.com/&quot; target=&quot;_blank&quot;&gt;000webhost&lt;/a&gt;是英文网站，如果你在注册或者使用过程里碰到什么问题，请留言，我很乐意帮忙。&lt;/p&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3563865031762309282-5653223713743177999?l=www.61dh.com%2Fblog' alt='' /&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/323350929/61dev/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/61dev/~7212679/323350929/5321839/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/61dev/323350929/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/61dev/323350929/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category domain="http://www.blogger.com/atom/ns#">编程开发</category><pubDate>Wed, 25 Nov 2009 05:23:00 +0800</pubDate><author>noreply@blogger.com (D Cai)</author><guid isPermaLink="false">tag:blogger.com,1999:blog-3563865031762309282.post-5653223713743177999</guid><dc:creator>noreply@blogger.com (D Cai)</dc:creator><fs:srclink>http://www.61dh.com/blog/2009/11/blog-post_24.html</fs:srclink><fs:srcfeed>http://www.61dh.com/blog/rss.xml</fs:srcfeed><fs:itemid>feedsky/61dev/~7212679/323350929/5321839</fs:itemid></item><item><title>使用wamp碰到的几个问题</title><link>http://item.feedsky.com/~feedsky/61dev/~7212679/323350930/5321839/1/item.html</link><thr:total>0</thr:total><description>&lt;p&gt;在日常工作里我用LAMP(Linux Apache MySQ PHP)比较多。我在日志里曾经提到我开始使用Windows下IDE (&lt;a href=&quot;http://www.61dh.com/blog/2009/08/netbean-ide-for-php.html&quot;&gt;NetBean IDE for PHP&lt;/a&gt; 其实后来我改用Eclipse了, 至于为什么改用Eclipse，有机会我再介绍。) 既然使用Windows下的IDE，我自然要在Windows下安装Apache，MySQL和PHP，关于如何设置WAMP(Windows Apache MySQ PHP)上网一搜一定会抓到一大把，但是你可能还要花点功夫进行参数修改。而我这次使用到的是WAMP傻瓜安装软件。估计很多朋友也用过或者正在使用，这里也不做详述，只是想做个记录。&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;到wampserver官方网站下在WampServer (当前版本2.0i), &lt;a href=&quot;http://www.wampserver.com/en/download.php&quot; target=&quot;_blank&quot;&gt;英文链接&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;下载后安装。很简单什么都是自动的。 &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;下面是我在使用wamp过程中碰到几个问题：&lt;/p&gt;  &lt;p&gt;1. Wamp默认安装只是选择性激活apache模块和php extension，例如它没有激活mod_rewrite模块，所以你如果要在.htaccess里定义mod rewrite， 你必需自己激活这个模块。很简单左键点击任务栏wamp图标，选择apache –&amp;gt; apache modules –&amp;gt; rewrite_module&lt;/p&gt;  &lt;p&gt;2. 默认安装没有给mySQL的root设置密码，所以当你登入phpMyAdmin (&lt;a href=&quot;http://localhost/phpmyadmin/&quot;&gt;http://localhost/phpmyadmin/&lt;/a&gt;)你看到提示信息，建议你设置密码。你可以直接通过phpmyadmin给root设置密码或者通过&lt;a href=&quot;http://www.61dh.com/blog/categories/mysql-command.html&quot; target=&quot;_blank&quot;&gt;mysql命令行&lt;/a&gt;来修改&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;在phpMyAdmin页面，点击Privileges -&amp;gt; User overview –&amp;gt; Edit privileges &lt;/li&gt;    &lt;li&gt;通过命令行设置root密码 (注意：你可能要把c:/wamp/bin添加到Windows的环境变量里，要不然，不可以直接在命令行使用mysql &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;3. 设置好密码后，重新登入phpMyAdmin，你可能会无法登入。这是因为默认安装下，phpMyAdmin采用自动登入，你更改了密码，但是没有把密码写到phpMyAdmin的配置文件里。解决办法有两种： &lt;/p&gt;  &lt;p&gt;方法一：把密码加入配置文件，c:/wmap/apps/phpmyadmin/config.inc.php &lt;/p&gt;  &lt;p&gt;   &lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$cfg['Servers'][$i]['password'] = 'xxxx';
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;//这行默认下是密码为空，加入你刚刚修改的密码&lt;/pre&gt;&lt;/pre&gt;
&lt;/p&gt;

&lt;p&gt;方法二：关闭自动登入，依然通过修改c:/wmap/apps/phpmyadmin/config.inc.php &lt;/p&gt;

&lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$cfg['blowfish_secret'] = 'cpzhanrock'; &lt;span style=&quot;color: #008000&quot;&gt;//必须加入任意serect字符串。&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;/* Servers configuration */&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$i = 0;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;/* Server: localhost [1] */&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$i++;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$cfg['Servers'][$i]['auth_type'] = 'cookie'; &lt;span style=&quot;color: #008000&quot;&gt;//设定auth_type为cookie&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;//把其他cfg['Servers']设置都删除！！！！&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;//下面为可选配置&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$cfg['DefaultLang'] = 'en-utf-8';&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$cfg['ServerDefault'] = 1;&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$cfg['UploadDir'] = '';&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$cfg['SaveDir'] = '';&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;我认为wamp应该算Windows下安装Apache、MySQL、PHP和phpMyAdmin的最好用的工具软件。&lt;/p&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3563865031762309282-5747203665677810794?l=www.61dh.com%2Fblog' alt='' /&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/323350930/61dev/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/61dev/~7212679/323350930/5321839/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/61dev/323350930/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/61dev/323350930/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category domain="http://www.blogger.com/atom/ns#">编程开发</category><pubDate>Wed, 25 Nov 2009 04:01:00 +0800</pubDate><author>noreply@blogger.com (D Cai)</author><guid isPermaLink="false">tag:blogger.com,1999:blog-3563865031762309282.post-5747203665677810794</guid><dc:creator>noreply@blogger.com (D Cai)</dc:creator><fs:srclink>http://www.61dh.com/blog/2009/11/wamp.html</fs:srclink><fs:srcfeed>http://www.61dh.com/blog/rss.xml</fs:srcfeed><fs:itemid>feedsky/61dev/~7212679/323350930/5321839</fs:itemid></item><item><title>网页同时含有安全性与非安全性的项目</title><link>http://item.feedsky.com/~feedsky/61dev/~7212679/323350931/5321839/1/item.html</link><thr:total>0</thr:total><description>&lt;p&gt;当网页内包含HTTP及HTTPS的内容时，在IE下会出现弹出 &amp;quot;…网页同时含有安全性与非安全性的项目…&amp;quot;的警告讯息；在Firefox下，你将看到有下角的安全锁图标裂开了。这通常不是什么大问题。&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;如何你在浏览别人的网站，&lt;/strong&gt; &lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;在IE下你可以通过：      &lt;br /&gt;工具-&amp;gt;选项-&amp;gt;安全性-&amp;gt;自订等级将『显示混合的内容』由&amp;quot;提示&amp;quot;修改为&amp;quot;启用&amp;quot;即可。&lt;/li&gt;    &lt;li&gt;在Forefox下，你可以忽略那个裂开的安全锁。&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&lt;strong&gt;如果你拥有这个网站&lt;/strong&gt;，那么你应该考虑避免在安全页面包含非安全的元素，也就是在https页面里，把http://打头的href用https://或者相对路径代替。当然，前提是该元素可以通过https接入。&lt;/p&gt;  &lt;p&gt;https是需要购买安全证书的，不是什么网站随随便便在前面加上https就可以访问，例如:https://www.61dh.com是不可以访问的，因为我没有买安全证书。另外SSL安全证书是和域名对应的，比如说我买了&lt;a href=&quot;https://secure.61dh.com&quot;&gt;https://secure.61dh.com&lt;/a&gt;，它只对sercure.61dh.com生效，而&lt;a href=&quot;https://www.61dh.com&quot;&gt;https://www.61dh.com&lt;/a&gt;依然无法访问。&lt;/p&gt;  &lt;p&gt;如果一个安全页面上含有非安全元素(通常是链接或者图片)，并且这些链接不支持安全连接。那么应该怎么办呢？&lt;/p&gt;  &lt;p&gt;这里要介绍两个可行解决方案。(&lt;strong&gt;注意：下面用到&lt;/strong&gt;&lt;a href=&quot;https://secure.61dh.com&quot;&gt;&lt;strong&gt;https://secure.61dh.com&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;只是用来举例说明的，它并不存在。）&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;方法一：在服务器配置文件里加入安全到非安全的跳转&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;在Apache服务器下，当访问https://安全页面时通常要先到达ssl.conf，而访问不安全页面通常先到达http.conf。所以我们可以在ssl.conf里对某些url进行跳转。这种方法是用于同域名跳转，例如：&lt;/p&gt;  &lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;RewriteCond   %{REQUEST_URI}  !^/cart/checkout/.*$
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;RewriteRule   ^/(.*)$         http:&lt;span style=&quot;color: #008000&quot;&gt;//%{HTTP_HOST}/$1  [R,L]&lt;/span&gt;
&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;上述Rewrite Rule，可以实现 &lt;a href=&quot;https://secure.61dh.com/cart/&quot;&gt;https://secure.61dh.com/cart/&lt;/a&gt; 到&lt;a href=&quot;http://www.61dh.com/cart&quot;&gt;http://www.61dh.com/cart&lt;/a&gt; 的跳转。&lt;/p&gt;

&lt;p&gt;&lt;strong&gt; 方法二：使用PHP跳转代码&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;当安全页面含有外部链接时，这个方法很适用。例如在&lt;a href=&quot;https://secure.61dh.com&quot;&gt;https://secure.61dh.com&lt;/a&gt;页面里含有&lt;a href=&quot;http://www.cpzhan.com&quot;&gt;http://www.cpzhan.com&lt;/a&gt;的友情链接，我们可以把这个链接用安全链接来表示：&lt;/p&gt;

&lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&amp;lt;a href=&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;https://secure.61dh.com/redirect.php?to=http%3a%2f%2fwww.cpzhan.com&lt;/span&gt;&amp;quot;&amp;gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;彩票站&amp;lt;/a&amp;gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;注意：这里我用到redirect.php，这个文件支持安全链接，而非安全链接&lt;a href=&quot;http://www.cpzhan.com&quot;&gt;http://www.cpzhan.com&lt;/a&gt;被当成变量。redirect.php代码很简单，如下：&lt;/p&gt;

&lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;?&lt;/span&gt;php
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$to    = isset($_GET['&lt;span style=&quot;color: #8b0000&quot;&gt;to&lt;/span&gt;'])      ?  $_GET['&lt;span style=&quot;color: #8b0000&quot;&gt;to&lt;/span&gt;']       : '&lt;span style=&quot;color: #8b0000&quot;&gt;&lt;/span&gt;';
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/if&quot;&gt;if&lt;/a&gt; ($to){
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;   &lt;a style=&quot;color: #ffa500&quot; href=&quot;http://www.php.net/header&quot;&gt;header&lt;/a&gt;(&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;Location: $to&lt;/span&gt;&amp;quot;) ;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;   &lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/exit&quot;&gt;exit&lt;/a&gt;;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;}
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3563865031762309282-5165367050290870502?l=www.61dh.com%2Fblog' alt='' /&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/323350931/61dev/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/61dev/~7212679/323350931/5321839/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/61dev/323350931/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/61dev/323350931/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category domain="http://www.blogger.com/atom/ns#">PHP</category><category domain="http://www.blogger.com/atom/ns#">编程开发</category><pubDate>Tue, 10 Nov 2009 06:09:00 +0800</pubDate><author>noreply@blogger.com (D Cai)</author><guid isPermaLink="false">tag:blogger.com,1999:blog-3563865031762309282.post-5165367050290870502</guid><dc:creator>noreply@blogger.com (D Cai)</dc:creator><fs:srclink>http://www.61dh.com/blog/2009/11/blog-post.html</fs:srclink><fs:srcfeed>http://www.61dh.com/blog/rss.xml</fs:srcfeed><fs:itemid>feedsky/61dev/~7212679/323350931/5321839</fs:itemid></item><item><title>jTester 简单的jQuery测试工具</title><link>http://item.feedsky.com/~feedsky/61dev/~7212679/323350932/5321839/1/item.html</link><thr:total>0</thr:total><description>&lt;p&gt;今天做了一个简单的jQuery测试工具，把它命名为jTester。Google了一下好像这个名字已经有好多人在用，应该没有什么命名侵权的问题吧。:-)&lt;/p&gt;  &lt;p&gt;做这个测试工具的原因是，我经常要测试一些jQuery代码，每次都要建立一个新文件，然后还要在header里引用jQuery库，觉得挺麻烦的。现在有了这个工具，我只要在文本框里直接写入HTML正文部分(包括HTML代码和jQuery代码)，然后点击按钮就可以查看结果了。&lt;/p&gt;  &lt;p&gt;我写的&lt;a href=&quot;http://www.61dh.com/blog/categories/jquery-basic.html&quot; target=&quot;_blank&quot;&gt;jQuery基础系列文章&lt;/a&gt;里有很多jQuery代码片段，初学jQuery的朋友可以把代码直接粘贴到&lt;a href=&quot;http://www.61dh.com/jtester/&quot; target=&quot;_blank&quot;&gt;jQuery Tester&lt;/a&gt;里，然后进行修改和测试。&lt;/p&gt;  &lt;p&gt;这个测试工具是根据著名W3SCHOOLS在线测试工具修改而来，目前功能很简单，准备在今后加入一些新功能，例如：&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;可以选择不同的jQuery版本 &lt;/li&gt;    &lt;li&gt;语法加亮 &lt;/li&gt;    &lt;li&gt;显示错误信息 &lt;/li&gt;    &lt;li&gt;... &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;有兴趣的朋友可以试试看，如果你觉得好用，请推荐给你的朋友；如果你有任何意见或者建议，请留言。谢谢！&lt;/p&gt;  &lt;h3&gt;&lt;a href=&quot;http://www.61dh.com/jtester/&quot; target=&quot;_blank&quot;&gt;请点击这里进入工具&lt;/a&gt;&lt;/h3&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3563865031762309282-4464466060561081851?l=www.61dh.com%2Fblog' alt='' /&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/323350932/61dev/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/61dev/~7212679/323350932/5321839/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/61dev/323350932/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/61dev/323350932/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category domain="http://www.blogger.com/atom/ns#">Jquery</category><category domain="http://www.blogger.com/atom/ns#">编程开发</category><pubDate>Fri, 23 Oct 2009 10:57:00 +0800</pubDate><author>noreply@blogger.com (D Cai)</author><guid isPermaLink="false">tag:blogger.com,1999:blog-3563865031762309282.post-4464466060561081851</guid><dc:creator>noreply@blogger.com (D Cai)</dc:creator><fs:srclink>http://www.61dh.com/blog/2009/10/jtester-jquery.html</fs:srclink><fs:srcfeed>http://www.61dh.com/blog/rss.xml</fs:srcfeed><fs:itemid>feedsky/61dev/~7212679/323350932/5321839</fs:itemid></item><item><title>使用YUI Compressor给JavaScript和CSS瘦身</title><link>http://item.feedsky.com/~feedsky/61dev/~7212679/323350933/5321839/1/item.html</link><thr:total>0</thr:total><description>&lt;p&gt;减小Javascript和CSS的体积有助于加快页面的加载速度。Javascript或者CSS的压缩器在英文里称为compressor，它主要是移除空格和注释来缩小体积。当然优秀的压缩器象YUI Compressor还具有打乱局部符号和优化代码等功能(特别针对JavaScript)。如果你的Javascript或者CSS本身就没有几行，那么你可能感受不到瘦身的效果；反之，通过压缩后的文件体积通常可以缩小40%-50%。&lt;/p&gt;  &lt;p&gt;之前我已经用过一些在线工具来压缩网站的JavaScript和CSS代码，但是觉得用其来不是很方便。每次对Javascript和CSS稍作修改，都要把代码拷贝粘贴到在线工具里，然后在把压缩后的版本拷贝粘帖到本地保存。后来想自己网站上的Javascript和CSS本身体积就不是很大，就索性不压缩了，省得麻烦。最近在优化公司的网站代码的时候，决定对Javascript和CSS瘦身，用到了YUI Compressor。很早以前就听说YUI Compressor了，一直没有机会去使用它。这次使用后觉得很好用，故在这里推荐给大家。&lt;/p&gt;  &lt;p&gt;我觉得YUI Compressor主要有3大优点：&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;同时支持Javascript和CSS的压缩。 &lt;/li&gt;    &lt;li&gt;用JAVA写的，可跨平台使用。它需要Java版本&amp;gt;=1.4，现在大部分机子应该都安装有Java，我在Window和Linux都试用过，没有出现任何问题。 &lt;/li&gt;    &lt;li&gt;压缩效果好。我分别用YUI Compressor和Dean Edwards的在线&lt;a href=&quot;http://javascriptcompressor.com/&quot; target=&quot;_blank&quot;&gt;Javascript Compressor&lt;/a&gt;对一个文件大小为8.341K的javascript进行压缩，YUI Compressor生成的文件大小为5.535K， 而在线Javascript Compressor生成的文件大小为5.985K。虽然Dean Edwards的JS Compressor还可以选择 Base62 encode(编码)和Shrink variable(收缩变量)，从而得到更小体积的文件(4.835K)。&lt;strong&gt;按照我的理解YUI Compressor是一种Minifier(缩小器)，正如文章开头提到的它主要是移除空格和注释来缩小体积，虽然它在一定程度上还缩小变量名和移除不必要的代码，但是比较保守。而Dean Edwards的JS Compressor可以称之为Packer(打包机)，它使用了不同的概念和更加先进的打包算法(例如：Shrink variable)，虽然它达到更小的体积，但是在性能上要打些折扣，因为客户端需要一定的时间去解压和使用它。&lt;/strong&gt;&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;使用YUI Compressor，可以说是非常简单。&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;首先到YUI Library&lt;a href=&quot;http://yuilibrary.com/downloads/#yuicompressor&quot; target=&quot;_blank&quot;&gt;官方下载页面&lt;/a&gt;，记住该页面有很多YUI的库，你要下载的是YUI Compressor。&lt;/li&gt;    &lt;li&gt;然后解压下载文件，记住直接可以用的是build文件夹下的yuicompressor-2.4.2.jar，另外下载的文件里还包含源代码、文档等等。&lt;/li&gt;    &lt;li&gt;把yuicompressor-2.4.2.jar拷贝到某个文件目录下，比如C:/tools(windows) 或者 /usr/adam/tools(Linux)。&lt;/li&gt;    &lt;li&gt;最后用下面的命令：&lt;/li&gt; &lt;/ol&gt;  &lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;//压缩Javascript&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;java -jar /path/to/yuicompressor-2.4.2.jar example.js -o example.min.js
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;#例如：java -jar c:\tools\yuicompressor-2.4.2.jar 61dh.js -o 61dh.min.js
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;//压缩CSS&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;java -jar /path/to/yuicompressor-2.4.2.jar example.css -o example.min.css
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;#例如：java -jar /usr/adam/tools/yuicompressor-2.4.2.jar 61dh.css -o 61dh.min.css&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;更多的用法，请参考YUI Compressor的&lt;a href=&quot;http://developer.yahoo.com/yui/compressor/&quot; target=&quot;_blank&quot;&gt;官方网页&lt;/a&gt;。&lt;/p&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3563865031762309282-3600314601004922976?l=www.61dh.com%2Fblog' alt='' /&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/323350933/61dev/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/61dev/~7212679/323350933/5321839/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/61dev/323350933/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/61dev/323350933/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category domain="http://www.blogger.com/atom/ns#">Javascript</category><category domain="http://www.blogger.com/atom/ns#">CSS</category><category domain="http://www.blogger.com/atom/ns#">编程开发</category><pubDate>Thu, 15 Oct 2009 10:57:00 +0800</pubDate><author>noreply@blogger.com (D Cai)</author><guid isPermaLink="false">tag:blogger.com,1999:blog-3563865031762309282.post-3600314601004922976</guid><dc:creator>noreply@blogger.com (D Cai)</dc:creator><fs:srclink>http://www.61dh.com/blog/2009/10/yui-compressorjavascriptcss.html</fs:srclink><fs:srcfeed>http://www.61dh.com/blog/rss.xml</fs:srcfeed><fs:itemid>feedsky/61dev/~7212679/323350933/5321839</fs:itemid></item><item><title>密码加密</title><link>http://item.feedsky.com/~feedsky/61dev/~7212679/323350934/5321839/1/item.html</link><thr:total>0</thr:total><description>&lt;p&gt;我经常在数据库的表里或者在代码里看到未经加密的密码，这是一个很不好的习惯。PHP里提供很多种的密码加密函数，在正式的项目开发里，我们应该要重视密码的加密。&lt;/p&gt;  &lt;p&gt;我们可以在用户注册帐号的时候，使用md5()或者sha1()加密用户输入的密码，然后保存在数据库里。下次用户登入的时候，把用户输入的密码通过md5()或者sha1()函数计算出加密值，然后用这个加密值和数据库里的保存密码进行比较，如果相等就代表密码正确，反之亦然。&lt;/p&gt;  &lt;p&gt;实例代码如下：&lt;/p&gt;  &lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;?&lt;/span&gt;hpp
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$pass=$_POST['&lt;span style=&quot;color: #8b0000&quot;&gt;pass&lt;/span&gt;']; 
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$save = md5($pass); &lt;span style=&quot;color: #008000&quot;&gt;//保存这个加密过的密码&lt;/span&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/if&quot;&gt;if&lt;/a&gt;(&lt;a style=&quot;color: #ffa500&quot; href=&quot;http://www.php.net/strcmp&quot;&gt;strcmp&lt;/a&gt;(md5($pass),$save)==0)
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  &lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/echo&quot;&gt;echo&lt;/a&gt;&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;密码正确&lt;/span&gt;&amp;quot;;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/else&quot;&gt;else&lt;/a&gt;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  &lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/echo&quot;&gt;echo&lt;/a&gt;&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;密码不对&lt;/span&gt;&amp;quot;;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;注意使用md5或者sha1()加密过后的值是不可以逆的，也就是说通过这个加密值你无法还原原始值。所以如果你忘记密码，你只有重新设置密码。&lt;/p&gt;

&lt;p&gt;有时候，你可能需要一个可以还原的加密方法。这时使用上面的加密函数就行不通了，但是你完全可以自己写一个，这里就要介绍一个用base64_encode()和base64_decode()来创建自定义密码加密的方法。&lt;/p&gt;

&lt;p&gt;首先，创建下来LIB文件，命名为pass.php, 保存在你的库文件目录下。&lt;/p&gt;

&lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;?&lt;/span&gt;php
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/function&quot;&gt;function&lt;/a&gt; myencode($str)
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;{
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  &lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/for&quot;&gt;for&lt;/a&gt;($i=0; $i&amp;lt;5;$i++)
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  {
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;    $str=&lt;a style=&quot;color: #ffa500&quot; href=&quot;http://www.php.net/strrev&quot;&gt;strrev&lt;/a&gt;(base64_encode($str));
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  }
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  &lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/return&quot;&gt;return&lt;/a&gt; $str;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;}
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/function&quot;&gt;function&lt;/a&gt; mydecode($str){
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  &lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/for&quot;&gt;for&lt;/a&gt;($i=0; $i&amp;lt;5;$i++)
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  {
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;    $str=base64_decode(&lt;a style=&quot;color: #ffa500&quot; href=&quot;http://www.php.net/strrev&quot;&gt;strrev&lt;/a&gt;($str)); 
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  }
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;  &lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/return&quot;&gt;return&lt;/a&gt; $str;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;}
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;然后，用下面的代码创建一个加密后的密码：&lt;/p&gt;

&lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;?&lt;/span&gt;php 
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/include&quot;&gt;include&lt;/a&gt; (&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;LIB/pass.php&lt;/span&gt;&amp;quot;);
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/echo&quot;&gt;echo&lt;/a&gt; myencode($argv[1]);
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;把上面代码命名为mypass.php, 然后在命令行运行:&lt;/p&gt;

&lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;php mypass.php 61dh
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;VZlSXRVVONXTWl1daZkVaNGbKVVVB1TP&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;最后，在实际代码里，使用这个来代替加密过的代码来代替真实密码。&lt;/p&gt;

&lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;?&lt;/span&gt;php
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;a style=&quot;color: #0000ff&quot; href=&quot;http://www.php.net/include&quot;&gt;include&lt;/a&gt; (&amp;quot;&lt;span style=&quot;color: #8b0000&quot;&gt;LIB/pass.php&lt;/span&gt;&amp;quot;);
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$pass = '&lt;span style=&quot;color: #8b0000&quot;&gt;VZlSXRVVONXTWl1daZkVaNGbKVVVB1TP&lt;/span&gt;';
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;$real_pass = mydeocde($pass);
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;当然，这种方法只是在一定程度上保护了密码，如果别人可以介入你的库文件(pass.php)，加密的字符串将马上就可以被还原。但是这总是比让人一目了然就看到你的密码来的好。&lt;/p&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3563865031762309282-4548749932320266237?l=www.61dh.com%2Fblog' alt='' /&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/323350934/61dev/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/61dev/~7212679/323350934/5321839/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/61dev/323350934/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/61dev/323350934/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category domain="http://www.blogger.com/atom/ns#">PHP</category><pubDate>Tue, 13 Oct 2009 05:04:00 +0800</pubDate><author>noreply@blogger.com (D Cai)</author><guid isPermaLink="false">tag:blogger.com,1999:blog-3563865031762309282.post-4548749932320266237</guid><dc:creator>noreply@blogger.com (D Cai)</dc:creator><fs:srclink>http://www.61dh.com/blog/2009/10/blog-post.html</fs:srclink><fs:srcfeed>http://www.61dh.com/blog/rss.xml</fs:srcfeed><fs:itemid>feedsky/61dev/~7212679/323350934/5321839</fs:itemid></item><item><title>mysql命令行 - 删除表</title><link>http://item.feedsky.com/~feedsky/61dev/~7212679/323350935/5321839/1/item.html</link><thr:total>0</thr:total><description>&lt;p&gt;上一节我们学习了如何删除表的条目。我们学到如果不加条件，表里的全部条目将全部被删除，但是这个操作不会删除表；表及其结构依然存在于数据库。这一节里我们要学习：&lt;/p&gt;  &lt;h3&gt;如何彻底地删除表？&lt;/h3&gt;  &lt;p&gt;如果你确定不再需要一个表了，你可以使用DROP。语法如下：&lt;/p&gt;  &lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;a style=&quot;color: #0000ff&quot; href=&quot;http://search.microsoft.com/default.asp?so=RECCNT&amp;amp;siteid=us%2Fdev&amp;amp;p=1&amp;amp;nq=NEW&amp;amp;qu=DROP&amp;amp;IntlSearch=&amp;amp;boolean=PHRASE&amp;amp;ig=01&amp;amp;i=09&amp;amp;i=99&quot;&gt;DROP&lt;/a&gt; &lt;a style=&quot;color: #0000ff&quot; href=&quot;http://search.microsoft.com/default.asp?so=RECCNT&amp;amp;siteid=us%2Fdev&amp;amp;p=1&amp;amp;nq=NEW&amp;amp;qu=TABLE&amp;amp;IntlSearch=&amp;amp;boolean=PHRASE&amp;amp;ig=01&amp;amp;i=09&amp;amp;i=99&quot;&gt;TABLE&lt;/a&gt; tablename&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;例如，我们要把这个系列用到的表employee_data删除，我们可以用到：&lt;/p&gt;

&lt;pre style=&quot;border-bottom: #cecece 1px solid; border-left: #cecece 1px solid; padding-bottom: 5px; background-color: #fbfbfb; min-height: 40px; padding-left: 5px; width: 578px; padding-right: 5px; overflow: auto; border-top: #cecece 1px solid; border-right: #cecece 1px solid; padding-top: 5px&quot;&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;&lt;a style=&quot;color: #0000ff&quot; href=&quot;http://search.microsoft.com/default.asp?so=RECCNT&amp;amp;siteid=us%2Fdev&amp;amp;p=1&amp;amp;nq=NEW&amp;amp;qu=DROP&amp;amp;IntlSearch=&amp;amp;boolean=PHRASE&amp;amp;ig=01&amp;amp;i=09&amp;amp;i=99&quot;&gt;DROP&lt;/a&gt; &lt;a style=&quot;color: #0000ff&quot; href=&quot;http://search.microsoft.com/default.asp?so=RECCNT&amp;amp;siteid=us%2Fdev&amp;amp;p=1&amp;amp;nq=NEW&amp;amp;qu=TABLE&amp;amp;IntlSearch=&amp;amp;boolean=PHRASE&amp;amp;ig=01&amp;amp;i=09&amp;amp;i=99&quot;&gt;TABLE&lt;/a&gt; employee_data;
&lt;/pre&gt;&lt;pre style=&quot;background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,&amp;#39;Courier New&amp;#39;,courier,monospace; font-size: 12px&quot;&gt;Query OK, 0 &lt;a style=&quot;color: #0000ff&quot; href=&quot;http://search.microsoft.com/default.asp?so=RECCNT&amp;amp;siteid=us%2Fdev&amp;amp;p=1&amp;amp;nq=NEW&amp;amp;qu=rows&amp;amp;IntlSearch=&amp;amp;boolean=PHRASE&amp;amp;ig=01&amp;amp;i=09&amp;amp;i=99&quot;&gt;rows&lt;/a&gt; affected (0.01 sec)&lt;/pre&gt;&lt;/pre&gt;

&lt;p&gt;好了，把eomplyee表删除也意味着这个mysql命令行系列的结束。在这个系列里我们一起学习了mysql的一些非常基本的查询语句，希望对mysql初学者可以提供一些帮助。当然在实际运用中，你往往要用到一些复杂的查询语句，但是万丈高楼平地起，相信在你掌握了这些基本知识以后，学习高级的mysql查询语句也不会太难。&lt;/p&gt;

&lt;p&gt;最后要感谢这个系列教程的原版：&lt;a title=&quot;http://www.webdevelopersnotes.com/tutorials/sql/index.php3&quot; href=&quot;http://www.webdevelopersnotes.com/tutorials/sql/index.php3&quot;&gt;http://www.webdevelopersnotes.com/tutorials/sql/index.php3&lt;/a&gt;。虽然有些章节我加入一些知识点，但是大部分都是翻译自这套mysql在线教程。&lt;/p&gt;  &lt;div class=&quot;blogger-post-footer&quot;&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3563865031762309282-1097048667155516050?l=www.61dh.com%2Fblog' alt='' /&gt;&lt;/div&gt;&lt;img src=&quot;http://www1.feedsky.com/t1/323350935/61dev/feedsky/s.gif?r=http://item.feedsky.com/~feedsky/61dev/~7212679/323350935/5321839/1/item.html&quot; border=&quot;0&quot; height=&quot;0&quot; width=&quot;0&quot; style=&quot;position:absolute&quot; /&gt;&lt;p class=&quot;fswww1&quot;&gt;&lt;a href=&quot;http://www1.feedsky.com/r/l/feedsky/61dev/323350935/art01.html&quot; target=&quot;_blank&quot;&gt;&lt;img border=&quot;0&quot; ismap=&quot;ismap&quot; src=&quot;http://www1.feedsky.com/r/i/feedsky/61dev/323350935/art01.gif&quot; onerror=&quot;this.style.display='none'&quot; /&gt;&lt;/a&gt;&lt;/p&gt;</description><category domain="http://www.blogger.com/atom/ns#">mySQL</category><category domain="http://www.blogger.com/atom/ns#">mysql命令行</category><pubDate>Fri, 09 Oct 2009 10:40:00 +0800</pubDate><author>noreply@blogger.com (D Cai)</author><guid isPermaLink="false">tag:blogger.com,1999:blog-3563865031762309282.post-1097048667155516050</guid><dc:creator>noreply@blogger.com (D Cai)</dc:creator><fs:srclink>http://www.61dh.com/blog/2009/10/mysql_08.html</fs:srclink><fs:srcfeed>http://www.61dh.com/blog/rss.xml</fs:srcfeed><fs:itemid>feedsky/61dev/~7212679/323350935/5321839</fs:itemid></item></channel></rss>