<?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://m955.com/wp/archives/tag/%e7%b6%b2%e9%a0%81/feed" rel="self" type="application/rss+xml" />
	<link>http://m955.com/wp</link>
	<description></description>
	<lastBuildDate>Thu, 03 Nov 2011 14:47:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>使用JavaScript驗證身份證號碼及其原理</title>
		<link>http://m955.com/wp/archives/103</link>
		<comments>http://m955.com/wp/archives/103#comments</comments>
		<pubDate>Sat, 05 Apr 2008 17:57:17 +0000</pubDate>
		<dc:creator>blue955</dc:creator>
				<category><![CDATA[架站]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[網頁]]></category>

		<guid isPermaLink="false">http://m955.com/wp/?p=103</guid>
		<description><![CDATA[使用JavaScript驗證身份證號碼及其原理
文∕趙英傑
電子商務或者一般的會員註冊網站，經常需要使用身份證號碼驗證程式。身份證號碼有一定的組成規則，以台灣地區為例，首碼一定是英文字... ]]></description>
			<content:encoded><![CDATA[<p>使用JavaScript驗證身份證號碼及其原理<br />
文∕趙英傑</p>
<p>電子商務或者一般的會員註冊網站，經常需要使用身份證號碼驗證程式。身份證號碼有一定的組成規則，以台灣地區為例，首碼一定是英文字母，後面跟著代表性別的數字1或2，然後再銜接8個數字。A123456789是一個合格的身份證號碼，驗證原理如下圖所示：</p>
<p><span id="more-103"></span></p>
<p><img src="http://farm4.static.flickr.com/3191/2390411442_2662b25df5_o.png" alt="" /></p>
<p>底下是驗證此號碼是否合格的計算公式：</p>
<p><img src="http://farm4.static.flickr.com/3035/2389576337_9b76548396_o.png" alt="" /></p>
<p>根據上圖的說明，我們可以用JavaScript的正規表達式（Regular Expression），加上簡易的字串與數學運算式，寫出如下的驗證函數：</p>
<div class="igBar"><span id="ljavascript-2"><a href="#" onclick="javascript:showPlainTxt('javascript-2'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JAVASCRIPT:</span>
<div id="javascript-2">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #003366; font-weight: bold;">function</span> checkID<span style="color: #66cc66;">&#40;</span>idStr<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">// 依照字母的編號排列，存入陣列備用。</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> letters = <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'A'</span>, <span style="color: #3366CC;">'B'</span>, <span style="color: #3366CC;">'C'</span>, <span style="color: #3366CC;">'D'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'E'</span>, <span style="color: #3366CC;">'F'</span>, <span style="color: #3366CC;">'G'</span>, <span style="color: #3366CC;">'H'</span>, <span style="color: #3366CC;">'J'</span>, <span style="color: #3366CC;">'K'</span>, <span style="color: #3366CC;">'L'</span>, <span style="color: #3366CC;">'M'</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'N'</span>, <span style="color: #3366CC;">'P'</span>, <span style="color: #3366CC;">'Q'</span>, <span style="color: #3366CC;">'R'</span>, <span style="color: #3366CC;">'S'</span>, <span style="color: #3366CC;">'T'</span>, <span style="color: #3366CC;">'U'</span>, <span style="color: #3366CC;">'V'</span>,</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; <span style="color: #3366CC;">'X'</span>, <span style="color: #3366CC;">'Y'</span>, <span style="color: #3366CC;">'W'</span>, <span style="color: #3366CC;">'Z'</span>, <span style="color: #3366CC;">'I'</span>, <span style="color: #3366CC;">'O'</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">// 儲存各個乘數</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> multiply = <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">1</span>, <span style="color: #CC0000;color:#800000;">9</span>, <span style="color: #CC0000;color:#800000;">8</span>, <span style="color: #CC0000;color:#800000;">7</span>, <span style="color: #CC0000;color:#800000;">6</span>, <span style="color: #CC0000;color:#800000;">5</span>,</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #CC0000;color:#800000;">4</span>, <span style="color: #CC0000;color:#800000;">3</span>, <span style="color: #CC0000;color:#800000;">2</span>, <span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> nums = <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> firstChar;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> firstNum;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> lastNum;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> total = <span style="color: #CC0000;color:#800000;">0</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">// 撰寫「正規表達式」。第一個字為英文字母，</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">// 第二個字為1或2，後面跟著8個數字，不分大小寫。</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #003366; font-weight: bold;">var</span> regExpID=<span style="color: #0066FF;">/^<span style="color: #66cc66;">&#91;</span>a-z<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#40;</span><span style="color: #CC0000;color:#800000;">1</span>|<span style="color: #CC0000;color:#800000;">2</span><span style="color: #66cc66;">&#41;</span>\d<span style="color: #66cc66;">&#123;</span><span style="color: #CC0000;color:#800000;">8</span><span style="color: #66cc66;">&#125;</span>$/i</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #009900; font-style: italic;">// 使用「正規表達式」檢驗格式</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>idStr.<span style="color: #006600;">search</span><span style="color: #66cc66;">&#40;</span>regExpID<span style="color: #66cc66;">&#41;</span>==-<span style="color: #CC0000;color:#800000;">1</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900; font-style: italic;">// 基本格式錯誤</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000066;">alert</span><span style="color: #66cc66;">&#40;</span>\<span style="color: #3366CC;">"請仔細填寫身份證號碼<span style="color: #000099; font-weight: bold;">\"</span>);</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp;return false;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; } else {</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; // 取出第一個字元和最後一個數字。</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; firstChar = idStr.charAt(0).toUpperCase();</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; lastNum = idStr.charAt(9);</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; }</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; // 找出第一個字母對應的數字，並轉換成兩位數數字。</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; for (var i=0; i&lt;26; i++) {</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; if (firstChar == letters[i]) {</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp;&nbsp; &nbsp;firstNum = i + 10;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp;&nbsp; &nbsp;nums[0] = Math.floor(firstNum / 10);</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp;&nbsp; &nbsp;nums[1] = firstNum - (nums[0] * 10);</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp;&nbsp; &nbsp;break;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; }</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; }</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; // 執行加總計算</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; for(var i=0; i&lt;multiply.length; i++){</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; if (i&lt;2) {</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; total += nums[i] * multiply[i];</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; } else {</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; total += parseInt(idStr.charAt(i-1)) *</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;multiply[i];</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; }</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; }</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; // 和最後一個數字比對</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; if ((10 - (total % 10))!= lastNum) {</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; alert(<span style="color: #000099; font-weight: bold;">\"</span>身份證號碼寫錯了！<span style="color: #000099; font-weight: bold;">\"</span>);</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; &nbsp; return false;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; }</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">&nbsp; return true;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #3366CC;">} </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>文章轉載於：<a href="http://swf.com.tw/?p=94" target="_blank">http://swf.com.tw/?p=94</a></p>
]]></content:encoded>
			<wfw:commentRss>http://m955.com/wp/archives/103/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>FCKeditor 按鈕設定詳細說明</title>
		<link>http://m955.com/wp/archives/77</link>
		<comments>http://m955.com/wp/archives/77#comments</comments>
		<pubDate>Sat, 12 Jan 2008 04:07:30 +0000</pubDate>
		<dc:creator>blue955</dc:creator>
				<category><![CDATA[架站]]></category>
		<category><![CDATA[FCKeditor]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[網頁]]></category>

		<guid isPermaLink="false">http://m955.com/wp/archives/77</guid>
		<description><![CDATA[FCKeditor 的安裝你可以參考這一篇：有了 FCKeditor 你也可以用網頁創造自己的部落格
在安裝好了 FCKeditor 之後，預設的功能列把工具全開，令人感到眼花撩亂，而且會有安全性的問題，所以我們... ]]></description>
			<content:encoded><![CDATA[<p>FCKeditor 的安裝你可以參考這一篇：<a href="http://m955.com/wp/archives/76" target="_blank">有了 FCKeditor 你也可以用網頁創造自己的部落格</a></p>
<p>在安裝好了 FCKeditor 之後，預設的功能列把工具全開，令人感到眼花撩亂，而且會有安全性的問題，所以我們可以照著我們的需求來更改按鈕的設定與配置。</p>
<p><a href="http://farm3.static.flickr.com/2382/2186858582_f05581ba3a_o.png" target="_blank" rel="lightbox"><img src="http://farm3.static.flickr.com/2382/2186858582_b0cd85dee4_m.jpg" /></a> </p>
<p><span id="more-77"></span></p>
<ol>
<li>首先我們必須先開啟 FCKeditor 的配置檔 fckconfig.js，位置在 ./FCKeditor 下面就可以找到。      <br />&#160; </li>
<li>打開 fckconfig.js 之後，找 FCKConfig.ToolbarSets，底下就會有功能按鍵的設定，依照我們的需求增加或刪除。      <br />&#160; </li>
<li>各參數的中英對照： </li>
</ol>
<div align="center">
<table id="table1" style="border-collapse: collapse" bordercolor="#000000" cellspacing="0" cellpadding="2" width="90%" border="1">
<tbody>
<tr>
<td width="25%">參數</td>
<td width="25%">說明</td>
<td width="25%">參數</td>
<td width="25%">說明</td>
</tr>
<tr>
<td width="25%">Source</td>
<td width="25%">原始碼</td>
<td width="25%">DocProps</td>
<td width="25%">文件屬性</td>
</tr>
<tr>
<td width="25%">Save</td>
<td width="25%">儲存</td>
<td width="25%">NewPage</td>
<td width="25%">開新檔案</td>
</tr>
<tr>
<td width="25%">Preview</td>
<td width="25%">預覽</td>
<td width="25%">Templates</td>
<td width="25%">樣板</td>
</tr>
<tr>
<td width="25%">Cut</td>
<td width="25%">剪下</td>
<td width="25%">Copy</td>
<td width="25%">拷貝</td>
</tr>
<tr>
<td width="25%">Paste</td>
<td width="25%">貼上</td>
<td width="25%">PasteText</td>
<td width="25%">貼為純文字</td>
</tr>
<tr>
<td width="25%">PasteWord</td>
<td width="25%">從 Word 貼上</td>
<td width="25%">Print</td>
<td width="25%">列印</td>
</tr>
<tr>
<td width="25%">SpellCheck</td>
<td width="25%">拼字檢查</td>
<td width="25%">Undo</td>
<td width="25%">復原</td>
</tr>
<tr>
<td width="25%">Redo</td>
<td width="25%">復原</td>
<td width="25%">Find</td>
<td width="25%">尋找</td>
</tr>
<tr>
<td width="25%">Replace</td>
<td width="25%">取代</td>
<td width="25%">SelectAll</td>
<td width="25%">全選</td>
</tr>
<tr>
<td width="25%">RemoveFormat</td>
<td width="25%">清除格式</td>
<td width="25%">Form</td>
<td width="25%">表單</td>
</tr>
<tr>
<td width="25%">Checkbox</td>
<td width="25%">核取方塊</td>
<td width="25%">Radio</td>
<td width="25%">選項按鈕</td>
</tr>
<tr>
<td width="25%">TextField</td>
<td width="25%">文字區域</td>
<td width="25%">Select</td>
<td width="25%">下拉選單</td>
</tr>
<tr>
<td width="25%">Button</td>
<td width="25%">按鈕</td>
<td width="25%">ImageButton</td>
<td width="25%">影像按鈕</td>
</tr>
<tr>
<td width="25%">HiddenField</td>
<td width="25%">隱藏欄位</td>
<td width="25%">Bold</td>
<td width="25%">粗體</td>
</tr>
<tr>
<td width="25%">Italic</td>
<td width="25%">斜體</td>
<td width="25%">Underline</td>
<td width="25%">底線</td>
</tr>
<tr>
<td width="25%">StrikeThrough</td>
<td width="25%">刪除線</td>
<td width="25%">Subscript</td>
<td width="25%">下標字</td>
</tr>
<tr>
<td width="25%">Superscript</td>
<td width="25%">上標字</td>
<td width="25%">OrderedList</td>
<td width="25%">數字項目符號</td>
</tr>
<tr>
<td width="25%">UnorderedList</td>
<td width="25%">項目符號</td>
<td width="25%">Outdent</td>
<td width="25%">減少縮排</td>
</tr>
<tr>
<td width="25%">Indent</td>
<td width="25%">增加縮排</td>
<td width="25%">Blockquote</td>
<td width="25%">區塊引用</td>
</tr>
<tr>
<td width="25%">JustifyLeft</td>
<td width="25%">靠左</td>
<td width="25%">JustifyCenter</td>
<td width="25%">置中</td>
</tr>
<tr>
<td width="25%">JustifyRight</td>
<td width="25%">靠右</td>
<td width="25%">JustifyFull</td>
<td width="25%">左右對齊</td>
</tr>
<tr>
<td width="25%">Link</td>
<td width="25%">建立連結</td>
<td width="25%">Unlink</td>
<td width="25%">移除連結</td>
</tr>
<tr>
<td width="25%">Anchor</td>
<td width="25%">錨點</td>
<td width="25%">Image</td>
<td width="25%">插入圖片</td>
</tr>
<tr>
<td width="25%">Flash</td>
<td width="25%">插入Flash</td>
<td width="25%">Table</td>
<td width="25%">插入表格</td>
</tr>
<tr>
<td width="25%">Rule</td>
<td width="25%">插入水平線</td>
<td width="25%">Smiley</td>
<td width="25%">表情符號</td>
</tr>
<tr>
<td width="25%">SpecialChar</td>
<td width="25%">特殊符號</td>
<td width="25%">PageBreak</td>
<td width="25%">分頁符號</td>
</tr>
<tr>
<td width="25%">Style</td>
<td width="25%">樣式</td>
<td width="25%">FontFormat</td>
<td width="25%">字體格式</td>
</tr>
<tr>
<td width="25%">FontName</td>
<td width="25%">字型選擇</td>
<td width="25%">FontSize</td>
<td width="25%">字型大小</td>
</tr>
<tr>
<td width="25%">TextColor</td>
<td width="25%">文字顏色</td>
<td width="25%">BGColor</td>
<td width="25%">背景顏色</td>
</tr>
<tr>
<td width="25%">FitWindow</td>
<td width="25%">編輯器最大化</td>
<td width="25%">ShowBlocks</td>
<td width="25%">顯示HTML標籤區塊</td>
</tr>
<tr>
<td width="25%">About</td>
<td width="25%">關於FCKeditor</td>
<td width="25%">&#160;</td>
<td width="25%">&#160;</td>
</tr>
</tbody>
</table></div></p>
]]></content:encoded>
			<wfw:commentRss>http://m955.com/wp/archives/77/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>有了 FCKeditor 你也可以用網頁創造自己的部落格</title>
		<link>http://m955.com/wp/archives/76</link>
		<comments>http://m955.com/wp/archives/76#comments</comments>
		<pubDate>Fri, 11 Jan 2008 15:47:20 +0000</pubDate>
		<dc:creator>blue955</dc:creator>
				<category><![CDATA[架站]]></category>
		<category><![CDATA[FCKeditor]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[網頁]]></category>

		<guid isPermaLink="false">http://m955.com/wp/archives/76</guid>
		<description><![CDATA[FCKeditor 是一個強大的線上編輯器，它常常出現在我們的周圍，不過你應該沒發覺到，無名的編輯器就是採用 FCKeditor 系統，包括WP也有 FCKeditor 的編輯器外掛，它免費，可自由散佈，真是感謝作... ]]></description>
			<content:encoded><![CDATA[<p>FCKeditor 是一個強大的線上編輯器，它常常出現在我們的周圍，不過你應該沒發覺到，無名的編輯器就是採用 FCKeditor 系統，包括WP也有 FCKeditor 的編輯器外掛，它免費，可自由散佈，真是感謝作者這麼無私的提供了一套這麼好的軟體來供給我們使用！</p>
<p><a target="_blank" href="http://farm3.static.flickr.com/2021/2184706911_108b907240_o.gif" rel="lightbox"><img src="http://farm3.static.flickr.com/2021/2184706911_9493853b8b_m.jpg" /></a></p>
<p>如果今天我們心血來潮，想自己創造一個BLOG，那麼編輯器我首推 FCKeditor，其實它可以應用的地方很多，例如討論區的編輯器也可以採用，有很多方向可以思考。</p>
<p>來介紹一下 FCKeditor 的安裝方式吧！很難嗎？放心，安裝 FCKeditor 絕對比安裝 WP 簡單的多！</p>
<p><span id="more-76"></span><br />
<strong><font color="#0000ff">第一步：</font></strong><br />
先連到 FCKeditor 的官方網站下載最新的版本，官網也有多詳細的安裝及介紹資訊，如果你看的懂的話，我自己是看不懂，另外這裡有線上的 <a target="_blank" href="http://www.fckeditor.net/demo">FCKeditor 展示</a>，可以讓你先試用看看，不過我相信大家都很熟了。</p>
<p><font color="#0000ff"><strong>第二步：</strong></font><br />
把下載回來的 FCKeditor 解壓縮到網站的根目錄下，FCKeditor 支援很多的版本安裝，如 ASP、JAVA、PHP...等，這裡使用的是 PHP 版本來做示範。在網頁中加入底下幾行參數：</p>
<div class="igBar"><span id="lphp-6"><a href="#" onclick="javascript:showPlainTxt('php-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-6">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">include</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"FCKeditor/fckeditor.php"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$oFCKeditor</span> = <span style="color:#000000; font-weight:bold;">new</span> FCKeditor<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'FCKeditor1'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$oFCKeditor</span>-&gt;<span style="color:#006600;">BasePath</span> = <span style="color:#FF0000;">'./FCKeditor/'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$oFCKeditor</span>-&gt;<span style="color:#006600;">Value</span> = <span style="color:#FF0000;">''</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$oFCKeditor</span>-&gt;<span style="color:#006600;">Width</span>&nbsp; = <span style="color:#FF0000;">'50%'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$oFCKeditor</span>-&gt;<span style="color:#006600;">Height</span> = <span style="color:#FF0000;">'500'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$oFCKeditor</span>-&gt;<span style="color:#006600;">Config</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'SkinPath'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">'skins/silver/'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$oFCKeditor</span>-&gt;<span style="color:#006600;">ToolbarSet</span> = <span style="color:#FF0000;">'myBasic'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>然後在你需要放編輯的的地方，通常是 <strong><font color="#ff0000">&lt;form&gt;</font></strong> 裡，加入底下參數：</p>
<div class="igBar"><span id="lphp-7"><a href="#" onclick="javascript:showPlainTxt('php-7'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-7">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#0000FF;">$oFCKeditor</span>-&gt;<span style="color:#006600;">Create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>這樣就可以了開你的網頁來看看你剛剛做好的 FCKeditor ，沒錯！就是這麼簡單！</p>
<p>一些細部的地方還是需要設定一下！先來說說上面個參數的意義好了！</p>
<p><font color="#0000ff"><strong>第一行</strong></font> include("FCKeditor/fckeditor.php");<br />
這是網頁一開始要嵌入的設定檔，這裡要注意一下路徑及資料夾檔名的問題，請按照你網站實際的情形修改。</p>
<p><strong><font color="#0000ff">第二行</font></strong> $oFCKeditor = new FCKeditor('FCKeditor1');<br />
這是設定編輯器的文章內容，所要存放的變數空間，等一下才可以用 <strong><font color="#ff0000">$_POST['FCKeditor1']</font></strong> 或 <strong><font color="#ff0000">$_GET['FCKeditor1']</font></strong> 來發送或是存取。</p>
<p><strong><font color="#0000ff">第三行</font></strong> $oFCKeditor-&gt;BasePath = './FCKeditor/';<br />
存放 FCKeditor 資料夾的原始路徑。也是要注意檔名及路徑的問題。</p>
<p><strong><font color="#0000ff">第四行</font></strong> $oFCKeditor-&gt;Value = '';<br />
這是設定編輯器一開始要顯示在編輯區塊的訊息，如果不希望有任何訊息顯示，保持空值即可。</p>
<p><strong><font color="#0000ff">第五、六行</font></strong> Width、Height<br />
這是設定編輯器的寬跟高。</p>
<p><font color="#0000ff"><strong>第七行</strong></font> $oFCKeditor-&gt;Config['SkinPath'] = 'skins/silver/';<br />
這是設定面板佈景，FCKeditor 預設有三個面板可以更換，位置在 ./FCKeditor/editor/skins 裡，有 default、office2003、silver 三個可以選擇。</p>
<p><font color="#0000ff"><strong>第八行</strong></font> $oFCKeditor-&gt;ToolbarSet = 'myBasic';<br />
這裡可以選擇按鈕的配置檔，設定檔在 ./FCKeditor/fckconfig.js 裡的 FCKConfig.ToolbarSets，預設有 [Default] [Basic] 可以選擇，不過 Default 的功能全開，會有安全性的疑慮，而 Basic 的功能又太少，所以我們可以在下面自訂一個功能列，然後在網夜裡使用這個指令呼叫。</p>
<p>而下面放在 <font color="#ff0000"><strong>&lt;form&gt;</strong></font> 這一行 &lt;?php $oFCKeditor-&gt;Create(); ?&gt; 是用來呼叫出 FCKeditor 的。</p>
<p>建立修改頁面</p>
<div class="igBar"><span id="lphp-8"><a href="#" onclick="javascript:showPlainTxt('php-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-8">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">require_once</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'Connections/fck.php'</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#616100;">include</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"FCKeditor/fckeditor.php"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$oFCKeditor</span> = <span style="color:#000000; font-weight:bold;">new</span> FCKeditor<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">'FCKeditor1'</span><span style="color:#006600; font-weight:bold;">&#41;</span>&nbsp; ;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$oFCKeditor</span>-&gt;<span style="color:#006600;">BasePath</span> = <span style="color:#FF0000;">'./FCKeditor/'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$oFCKeditor</span>-&gt;<span style="color:#006600;">Value</span> = <span style="color:#0000FF;">$row_Recordset1</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'content'</span><span style="color:#006600; font-weight:bold;">&#93;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$oFCKeditor</span>-&gt;<span style="color:#006600;">Width</span>&nbsp; = <span style="color:#FF0000;">'100%'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$oFCKeditor</span>-&gt;<span style="color:#006600;">Height</span> = <span style="color:#FF0000;">'500'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$oFCKeditor</span>-&gt;<span style="color:#006600;">Config</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#FF0000;">'SkinPath'</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#FF0000;">'skins/silver/'</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#0000FF;">$oFCKeditor</span>-&gt;<span style="color:#006600;">ToolbarSet</span> = <span style="color:#FF0000;">'myBasic'</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;!DOCTYPE HTML PUBLIC <span style="color:#FF0000;">"-//W3C//DTD HTML 4.01 Transitional//EN"</span> <span style="color:#FF0000;">"http://www.w3.org/TR/html4/loose.dtd"</span>&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;html&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;head&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;meta http-equiv=<span style="color:#FF0000;">"Content-Type"</span> content=<span style="color:#FF0000;">"text/html; charset=big5"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;title&gt;編輯&lt;/title&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/head&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;body&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;form method=<span style="color:#FF0000;">"POST"</span> action=<span style="color:#FF0000;">"&lt;?php echo $editFormAction; ?&gt;"</span> name=<span style="color:#FF0000;">"edit"</span>&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;table width=<span style="color:#FF0000;">"80%"</span>&nbsp; border=<span style="color:#FF0000;">"1"</span> align=<span style="color:#FF0000;">"center"</span> cellpadding=<span style="color:#FF0000;">"4"</span> cellspacing=<span style="color:#FF0000;">"2"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;tr&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;td&gt;主題&lt;/td&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;td&gt;&lt;input name=<span style="color:#FF0000;">"subject"</span> type=<span style="color:#FF0000;">"text"</span> id=<span style="color:#FF0000;">"subject"</span> value=<span style="color:#FF0000;">"&lt;?php echo $row_Recordset1['subject']; ?&gt;"</span> size=<span style="color:#FF0000;">"50"</span>&gt;&lt;/td&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;/tr&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;tr&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;td&gt;時間&lt;/td&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;td&gt;&lt;input name=<span style="color:#FF0000;">"date"</span> type=<span style="color:#FF0000;">"text"</span> id=<span style="color:#FF0000;">"date"</span> value=<span style="color:#FF0000;">"&lt;?php echo $row_Recordset1['date']; ?&gt;"</span>&gt;&lt;/td&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;/tr&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;tr&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;td colspan=<span style="color:#FF0000;">"2"</span>&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp;<span style="color:#000000; font-weight:bold;">&lt;?php</span> <span style="color:#0000FF;">$oFCKeditor</span>-&gt;<span style="color:#006600;">Create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#41;</span>; <span style="color:#000000; font-weight:bold;">?&gt;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp;&nbsp; &nbsp;&lt;input name=<span style="color:#FF0000;">"content"</span> type=<span style="color:#FF0000;">"hidden"</span> id=<span style="color:#FF0000;">"content"</span> value=<span style="color:#FF0000;">"&lt;?php echo $row_Recordset1['content']; ?&gt;"</span>&gt;&lt;/td&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;/tr&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;tr&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &lt;td colspan=<span style="color:#FF0000;">"2"</span>&gt;&lt;input type=<span style="color:#FF0000;">"submit"</span> name=<span style="color:#FF0000;">"Submit"</span> value=<span style="color:#FF0000;">"送出"</span>&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &lt;input name=<span style="color:#FF0000;">"on"</span> type=<span style="color:#FF0000;">"hidden"</span> id=<span style="color:#FF0000;">"on"</span> value=<span style="color:#FF0000;">"&lt;?php echo $row_Recordset1['on']; ?&gt;"</span>&gt;&lt;/td&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &lt;/tr&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/table&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;input type=<span style="color:#FF0000;">"hidden"</span> name=<span style="color:#FF0000;">"MM_update"</span> value=<span style="color:#FF0000;">"edit"</span>&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/form&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/body&gt;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&lt;/html&gt;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">&lt;?php</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/mysql_free_result" target="_blank"><span style="color:#000066;">mysql_free_result</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF;">$Recordset1</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#000000; font-weight:bold;">?&gt;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
]]></content:encoded>
			<wfw:commentRss>http://m955.com/wp/archives/76/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>解決 MySQL 4.1 的亂碼問題</title>
		<link>http://m955.com/wp/archives/75</link>
		<comments>http://m955.com/wp/archives/75#comments</comments>
		<pubDate>Wed, 02 Jan 2008 15:23:59 +0000</pubDate>
		<dc:creator>blue955</dc:creator>
				<category><![CDATA[架站]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[網頁]]></category>

		<guid isPermaLink="false">http://m955.com/wp/archives/75</guid>
		<description><![CDATA[我想很多人都會碰到跟我一樣的問題，在從 MySQL 4.0 轉換到 MySQL 4.1 時，所遇到的亂碼問題，這些問題不外忽是 phpMyAdmin 顯示中文沒問題，到了網頁中變亂碼，不然就是 phpMyAdmin 中文亂碼，到了... ]]></description>
			<content:encoded><![CDATA[<p>我想很多人都會碰到跟我一樣的問題，在從 MySQL 4.0 轉換到 MySQL 4.1 時，所遇到的亂碼問題，這些問題不外忽是 phpMyAdmin 顯示中文沒問題，到了網頁中變亂碼，不然就是 phpMyAdmin 中文亂碼，到了網頁中中文正常。</p>
<p>MySQL 4.1 在 phpMyAdmin 看，多了一個文字校對的東西，這個應該就是罪魁禍首，找了一下 Google 果然同樣的問題很多，當然解決的方法也不下數十種，端看你所使用的套件是啥？</p>
<p><span id="more-75"></span></p>
<p>底下這個方法，我試過有效，不過這只針對自行撰寫 PHP 網頁者。</p>
<p>一般我們在寫 PHP 時，會另外寫一個專門處理 MySQL 連線的頁面，然後我們只需要在 <strong><font color="#ff0000">mysql_select_db($database_php123);</font></strong> 上面加入：</p>
<div class="igBar"><span id="lphp-10"><a href="#" onclick="javascript:showPlainTxt('php-10'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-10">
<div class="php">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/mysql_query" target="_blank"><span style="color:#000066;">mysql_query</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"SET NAMES 'big5'"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><a href="http://www.php.net/mysql_query" target="_blank"><span style="color:#000066;">mysql_query</span></a><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#FF0000;">"SET NAMES 'utf8'"</span><span style="color:#006600; font-weight:bold;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color:#008000;">/*選一行即可*/</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>就可以解決亂碼的問題了。至於 <strong><font color="#ff0000">utf-8</font></strong> 或 <font color="#ff0000"><strong>big5</strong></font>，要看你的網頁編碼是什麼？來決定。</p>
<p>如果是匯入 MySQL 出現亂碼，記得在匯入前，要把文字校對改為 utf8_general_ci，然後在匯入舊的 MySQL 4.0 檔案，照樣在 phpMyAdmin 應該可以正常顯示中文了。</p>
<p><img border="0" width="434" src="http://m955.com/wp/wp-content/uploads/mysql.gif" alt="mysql.gif" height="93" title="mysql.gif" /></p>
]]></content:encoded>
			<wfw:commentRss>http://m955.com/wp/archives/75/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

