<?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; PHP</title>
	<atom:link href="http://m955.com/wp/archives/tag/php/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>有了 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-4"><a href="#" onclick="javascript:showPlainTxt('php-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-4">
<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-5"><a href="#" onclick="javascript:showPlainTxt('php-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">PHP:</span>
<div id="php-5">
<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-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;">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-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;"><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>

