<?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>不小心便學會了電腦</title>
	<atom:link href="http://kinghei.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://kinghei.com</link>
	<description>Learning Computing without effort</description>
	<lastBuildDate>Mon, 20 Feb 2012 09:05:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PHP error_reporting</title>
		<link>http://kinghei.com/2012/02/20/php-error_reporting/</link>
		<comments>http://kinghei.com/2012/02/20/php-error_reporting/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 09:05:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[error_reporting]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[reporting]]></category>

		<guid isPermaLink="false">http://kinghei.com/?p=493</guid>
		<description><![CDATA[Example #1 error_reporting() examples &#60;?php // Turn off all error reporting error_reporting(0); // Report simple running errors error_reporting(E_ERROR &#124; E_WARNING &#124; E_PARSE); // Reporting E_NOTICE can be good too (to report uninitialized // variables or catch variable name misspellings ...) error_reporting(E_ERROR &#124; E_WARNING &#124; E_PARSE &#124; E_NOTICE); // Report all errors except E_NOTICE // This is the default value set in php.ini error_reporting(E_ALL ^ E_NOTICE); // Report all PHP errors (see changelog) error_reporting(E_ALL); // Report all PHP errors error_reporting(-1); // Same as error_reporting(E_ALL); ini_set('error_reporting', E_ALL); ?&#62;]]></description>
			<content:encoded><![CDATA[<p><strong>Example #1 <strong>error_reporting()</strong> examples</strong></p>
<div>
<div><code>&lt;?php</p>
<p>// Turn off all error reporting<br />
error_reporting(0);</p>
<p>// Report simple running errors<br />
error_reporting(E_ERROR | E_WARNING | E_PARSE);</p>
<p>// Reporting E_NOTICE can be good too (to report uninitialized<br />
// variables or catch variable name misspellings ...)<br />
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);</p>
<p>// Report all errors except E_NOTICE<br />
// This is the default value set in php.ini<br />
error_reporting(E_ALL ^ E_NOTICE);</p>
<p>// Report all PHP errors (see changelog)<br />
error_reporting(E_ALL);</p>
<p>// Report all PHP errors<br />
error_reporting(-1);</p>
<p>// Same as error_reporting(E_ALL);<br />
ini_set('error_reporting', E_ALL);</p>
<p>?&gt;</code></div>
</div>
<p><!--?php </p>
<p>// Turn off all error reporting<br />
error_reporting(0);</p>
<p>// Report simple running errors<br />
error_reporting(E_ERROR | E_WARNING | E_PARSE);</p>
<p>// Reporting E_NOTICE can be good too (to report uninitialized<br />
// variables or catch variable name misspellings ...)<br />
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);</p>
<p>// Report all errors except E_NOTICE<br />
// This is the default value set in php.ini<br />
error_reporting(E_ALL ^ E_NOTICE);</p>
<p>// Report all PHP errors (see changelog)<br />
error_reporting(E_ALL);</p>
<p>// Report all PHP errors<br />
error_reporting(-1);</p>
<p>// Same as error_reporting(E_ALL);<br />
ini_set('error_reporting', E_ALL);</p>
<p>?--></p>
]]></content:encoded>
			<wfw:commentRss>http://kinghei.com/2012/02/20/php-error_reporting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple mysql date diff function</title>
		<link>http://kinghei.com/2012/02/12/simple-mysql-date-diff-function/</link>
		<comments>http://kinghei.com/2012/02/12/simple-mysql-date-diff-function/#comments</comments>
		<pubDate>Sun, 12 Feb 2012 10:14:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://kinghei.com/?p=490</guid>
		<description><![CDATA[sameple 1: select * from table where datediff(createdate, NOW())=&#8217;0&#8242;;&#8221;); sameple 2: select * from table where createdate&#62;subDate(NOW(), &#8217;1&#8242;); &#160;]]></description>
			<content:encoded><![CDATA[<p><strong>sameple 1</strong>: select * from table where datediff(createdate, NOW())=&#8217;0&#8242;;&#8221;);</p>
<p><strong>sameple 2</strong>: select * from table where createdate&gt;subDate(NOW(), &#8217;1&#8242;);</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://kinghei.com/2012/02/12/simple-mysql-date-diff-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>backup &amp; ftp upload shell script</title>
		<link>http://kinghei.com/2012/02/09/backup-ftp-upload-shell-script/</link>
		<comments>http://kinghei.com/2012/02/09/backup-ftp-upload-shell-script/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 11:17:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://kinghei.com/?p=481</guid>
		<description><![CDATA[#!/bin/bash date=`date +%d`; tar -czvf ~/backup/htmlbackup_$date.tar.gz /var/www/html/&#62;/dev/null curl -T ~/backup/htmlbackup_$date.tar.gz ftp://user:password@mydomain.com]]></description>
			<content:encoded><![CDATA[<p>#!/bin/bash<br />
date=`date +%d`;<br />
tar -czvf ~/backup/htmlbackup_$date.tar.gz /var/www/html/&gt;/dev/null<br />
curl -T ~/backup/htmlbackup_$date.tar.gz ftp://user:password@mydomain.com</p>
]]></content:encoded>
			<wfw:commentRss>http://kinghei.com/2012/02/09/backup-ftp-upload-shell-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP page perfomance test by time</title>
		<link>http://kinghei.com/2012/02/02/php-page-perfomance-test-by-time/</link>
		<comments>http://kinghei.com/2012/02/02/php-page-perfomance-test-by-time/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 03:10:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://kinghei.com/?p=474</guid>
		<description><![CDATA[&#60;?php function processing_time($START=false) { $an = 4; // How much digit return after point if(!$START) return time() + microtime(); $END = time() + microtime(); return round($END &#8211; $START, $an); } ?&#62; &#60;?php require_once &#8220;./pageload.php&#8221;; $START = processing_time(); #####some code here######## $RESULT = processing_time($START); echo $RESULT; ?&#62;]]></description>
			<content:encoded><![CDATA[<p>&lt;?php</p>
<p>function processing_time($START=false)<br />
{<br />
$an = 4; // How much digit return after point</p>
<p>if(!$START) return time() + microtime();<br />
$END = time() + microtime();<br />
return round($END &#8211; $START, $an);<br />
}</p>
<p>?&gt;</p>
<p>&lt;?php<br />
require_once &#8220;./pageload.php&#8221;;<br />
$START = processing_time();</p>
<p>#####some code here########</p>
<p>$RESULT = processing_time($START);<br />
echo $RESULT;</p>
<p>?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://kinghei.com/2012/02/02/php-page-perfomance-test-by-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript input number only or text/number only</title>
		<link>http://kinghei.com/2012/02/02/javascript-input-number-only-or-textnumber-only/</link>
		<comments>http://kinghei.com/2012/02/02/javascript-input-number-only-or-textnumber-only/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 02:54:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[password]]></category>

		<guid isPermaLink="false">http://kinghei.com/?p=471</guid>
		<description><![CDATA[&#60;script type=&#8221;text/javascript&#8221;&#62; function numericonly(e){ var code; if (!e) var e = window.event; if (e.keyCode) code = e.keyCode; else if (e.which) code = e.which; var character = String.fromCharCode(code); //alert(&#8216;Character was &#8216; + character); //alert(code); //if (code == return true; var AllowRegex = /^[\b0-9.]$/; if (AllowRegex.test(character)) return true; return false; } function typetextandnumonly(e){ var code; if (!e) [...]]]></description>
			<content:encoded><![CDATA[<p>&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
function numericonly(e){<br />
var code;<br />
if (!e) var e = window.event;<br />
if (e.keyCode) code = e.keyCode;<br />
else if (e.which) code = e.which;<br />
var character = String.fromCharCode(code);<br />
//alert(&#8216;Character was &#8216; + character);<br />
//alert(code);<br />
//if (code == <img src='http://kinghei.com/wp-includes/images/smilies/icon_cool.gif' alt='8)' class='wp-smiley' /> return true;<br />
var AllowRegex = /^[\b0-9.]$/;<br />
if (AllowRegex.test(character)) return true;<br />
return false;<br />
}<br />
function typetextandnumonly(e){<br />
var code;<br />
if (!e) var e = window.event;<br />
if (e.keyCode) code = e.keyCode;<br />
else if (e.which) code = e.which;<br />
var character = String.fromCharCode(code);<br />
var AllowRegex = /^[a-zA-Z0-9]$/;<br />
if (AllowRegex.test(character)) return true;<br />
return false;<br />
}</p>
<p>&lt;/script&gt;</p>
<p>&nbsp;</p>
<p>&lt;input name=&#8221;password&#8221; type=&#8221;password&#8221; id=&#8221;password&#8221; size=&#8221;50&#8243; maxlength=&#8221;50&#8243; value=&#8221;" onkeypress=&#8221;return typetextandnumonly(event);&#8221; /&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://kinghei.com/2012/02/02/javascript-input-number-only-or-textnumber-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add months, days, years to PHP date()</title>
		<link>http://kinghei.com/2012/01/10/add-months-days-years-to-php-date/</link>
		<comments>http://kinghei.com/2012/01/10/add-months-days-years-to-php-date/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 07:12:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://kinghei.com/?p=468</guid>
		<description><![CDATA[$date = date(&#8220;Y-m-d&#8221;); $date = strtotime(date(&#8220;Y-m-d&#8221;, strtotime($date)) . &#8221; +12 month&#8221;); $date = date(&#8220;Y-m-d&#8221;,$date); echo $date; Other examples $date = strtotime(date(&#8220;Y-m-d&#8221;, strtotime($date)) . &#8221; +1 day&#8221;); $date = strtotime(date(&#8220;Y-m-d&#8221;, strtotime($date)) . &#8221; +1 week&#8221;); $date = strtotime(date(&#8220;Y-m-d&#8221;, strtotime($date)) . &#8221; +2 week&#8221;); $date = strtotime(date(&#8220;Y-m-d&#8221;, strtotime($date)) . &#8221; +1 month&#8221;); $date = strtotime(date(&#8220;Y-m-d&#8221;, strtotime($date)) . [...]]]></description>
			<content:encoded><![CDATA[<ol>
<li>
<div>$date = <a href="http://www.php.net/date" onclick="pageTracker._trackPageview('/outgoing/www.php.net/date?referer=');">date</a>(&#8220;Y-m-d&#8221;);</div>
</li>
<li>
<div>$date = <a href="http://www.php.net/strtotime" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strtotime?referer=');">strtotime</a>(<a href="http://www.php.net/date" onclick="pageTracker._trackPageview('/outgoing/www.php.net/date?referer=');">date</a>(&#8220;Y-m-d&#8221;, <a href="http://www.php.net/strtotime" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strtotime?referer=');">strtotime</a>($date)) . &#8221; +12 month&#8221;);</div>
</li>
<li>
<div>$date = <a href="http://www.php.net/date" onclick="pageTracker._trackPageview('/outgoing/www.php.net/date?referer=');">date</a>(&#8220;Y-m-d&#8221;,$date);</div>
</li>
<li>
<div><a href="http://www.php.net/echo" onclick="pageTracker._trackPageview('/outgoing/www.php.net/echo?referer=');">echo</a> $date;</div>
</li>
<li>
<div></div>
</li>
<li>
<div>Other examples</div>
</li>
<li>
<div>$date = <a href="http://www.php.net/strtotime" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strtotime?referer=');">strtotime</a>(<a href="http://www.php.net/date" onclick="pageTracker._trackPageview('/outgoing/www.php.net/date?referer=');">date</a>(&#8220;Y-m-d&#8221;, <a href="http://www.php.net/strtotime" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strtotime?referer=');">strtotime</a>($date)) . &#8221; +1 day&#8221;);</div>
</li>
<li>
<div>$date = <a href="http://www.php.net/strtotime" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strtotime?referer=');">strtotime</a>(<a href="http://www.php.net/date" onclick="pageTracker._trackPageview('/outgoing/www.php.net/date?referer=');">date</a>(&#8220;Y-m-d&#8221;, <a href="http://www.php.net/strtotime" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strtotime?referer=');">strtotime</a>($date)) . &#8221; +1 week&#8221;);</div>
</li>
<li>
<div>$date = <a href="http://www.php.net/strtotime" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strtotime?referer=');">strtotime</a>(<a href="http://www.php.net/date" onclick="pageTracker._trackPageview('/outgoing/www.php.net/date?referer=');">date</a>(&#8220;Y-m-d&#8221;, <a href="http://www.php.net/strtotime" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strtotime?referer=');">strtotime</a>($date)) . &#8221; +2 week&#8221;);</div>
</li>
<li>
<div>$date = <a href="http://www.php.net/strtotime" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strtotime?referer=');">strtotime</a>(<a href="http://www.php.net/date" onclick="pageTracker._trackPageview('/outgoing/www.php.net/date?referer=');">date</a>(&#8220;Y-m-d&#8221;, <a href="http://www.php.net/strtotime" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strtotime?referer=');">strtotime</a>($date)) . &#8221; +1 month&#8221;);</div>
</li>
<li>
<div>$date = <a href="http://www.php.net/strtotime" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strtotime?referer=');">strtotime</a>(<a href="http://www.php.net/date" onclick="pageTracker._trackPageview('/outgoing/www.php.net/date?referer=');">date</a>(&#8220;Y-m-d&#8221;, <a href="http://www.php.net/strtotime" onclick="pageTracker._trackPageview('/outgoing/www.php.net/strtotime?referer=');">strtotime</a>($date)) . &#8221; +30 days&#8221;);</div>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://kinghei.com/2012/01/10/add-months-days-years-to-php-date/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tera Term display chinese</title>
		<link>http://kinghei.com/2011/12/29/tera-term-display-chinese/</link>
		<comments>http://kinghei.com/2011/12/29/tera-term-display-chinese/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 07:54:01 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[com]]></category>
		<category><![CDATA[serial]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[telnet]]></category>
		<category><![CDATA[tera term]]></category>

		<guid isPermaLink="false">http://kinghei.com/?p=463</guid>
		<description><![CDATA[1) Change the &#8220;locale&#8221; to &#8220;cht&#8221;. 2) Change the &#8220;CodePage&#8221; to 950. If the chinese word still cannot be display, you can try to change another font. It&#8217;s work for me.]]></description>
			<content:encoded><![CDATA[<p>1) Change the &#8220;locale&#8221; to &#8220;cht&#8221;.</p>
<p>2) Change the &#8220;CodePage&#8221; to 950.</p>
<p><a href="http://kinghei.com/wp-content/uploads/2011/12/terminal.png"><img class="aligncenter size-full wp-image-464" title="terminal" src="http://kinghei.com/wp-content/uploads/2011/12/terminal.png" alt="" width="506" height="328" /></a></p>
<p>If the chinese word still cannot be display, you can try to change another font. It&#8217;s work for me.</p>
<p><a href="http://kinghei.com/wp-content/uploads/2011/12/font.png"><img class="aligncenter size-full wp-image-465" title="font" src="http://kinghei.com/wp-content/uploads/2011/12/font.png" alt="" width="447" height="357" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://kinghei.com/2011/12/29/tera-term-display-chinese/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>send a multipart email (both HTML and plain text)</title>
		<link>http://kinghei.com/2011/12/20/send-a-multipart-email-both-html-and-plain-text/</link>
		<comments>http://kinghei.com/2011/12/20/send-a-multipart-email-both-html-and-plain-text/#comments</comments>
		<pubDate>Tue, 20 Dec 2011 06:49:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[plaintext]]></category>

		<guid isPermaLink="false">http://kinghei.com/?p=460</guid>
		<description><![CDATA[Example 1 &#60;?php $notice_text = &#8220;This is a multi-part message in MIME format.&#8221;; $plain_text = &#8220;This is a plain text email.\r\nIt is very cool.&#8221;; $html_text = &#8220;&#60;html&#62;&#60;body&#62;This is an &#60;b style=&#8217;color:purple&#8217;&#62;HTML&#60;/b&#62; text email.\r\nIt is very cool.&#60;/body&#62;&#60;/html&#62;&#8221;; $semi_rand = md5(time()); $mime_boundary = &#8220;==MULTIPART_BOUNDARY_$semi_rand&#8221;; $mime_boundary_header = chr(34) . $mime_boundary . chr(34); $to = &#8216;abc@abc.com&#8217;; $bcc = &#8220;You [...]]]></description>
			<content:encoded><![CDATA[<h1>Example 1</h1>
<p>&lt;?php</p>
<p>$notice_text = &#8220;This is a multi-part message in MIME format.&#8221;;<br />
$plain_text = &#8220;This is a plain text email.\r\nIt is very cool.&#8221;;<br />
$html_text = &#8220;&lt;html&gt;&lt;body&gt;This is an &lt;b style=&#8217;color:purple&#8217;&gt;HTML&lt;/b&gt; text email.\r\nIt is very cool.&lt;/body&gt;&lt;/html&gt;&#8221;;</p>
<p>$semi_rand = md5(time());<br />
$mime_boundary = &#8220;==MULTIPART_BOUNDARY_$semi_rand&#8221;;<br />
$mime_boundary_header = chr(34) . $mime_boundary . chr(34);</p>
<p>$to = &#8216;abc@abc.com&#8217;;<br />
$bcc = &#8220;You &lt;you@you.com&gt;, Them &lt;them@them.com&gt;&#8221;;<br />
$from = &#8220;Me.com &lt;me@me.com&gt;&#8221;;<br />
$subject = &#8220;My Email&#8221;;</p>
<p>$body = &#8220;$notice_text</p>
<p>&#8211;$mime_boundary<br />
Content-Type: text/plain; charset=us-ascii<br />
Content-Transfer-Encoding: 7bit</p>
<p>$plain_text</p>
<p>&#8211;$mime_boundary<br />
Content-Type: text/html; charset=us-ascii<br />
Content-Transfer-Encoding: 7bit</p>
<p>$html_text</p>
<p>&#8211;$mime_boundary&#8211;&#8221;;</p>
<p>if (@mail($to, $subject, $body,<br />
&#8220;From: &#8221; . $from . &#8220;\n&#8221; .<br />
&#8220;bcc: &#8221; . $bcc . &#8220;\n&#8221; .<br />
&#8220;MIME-Version: 1.0\n&#8221; .<br />
&#8220;Content-Type: multipart/alternative;\n&#8221; .<br />
&#8221; boundary=&#8221; . $mime_boundary_header))<br />
echo &#8220;Email sent successfully.&#8221;;<br />
else<br />
echo &#8220;Email NOT sent successfully!&#8221;;<br />
?&gt;</p>
<p><a href="http://www.tek-tips.com/faqs.cfm?fid=2681" onclick="pageTracker._trackPageview('/outgoing/www.tek-tips.com/faqs.cfm?fid=2681&amp;referer=');">http://www.tek-tips.com/faqs.cfm?fid=2681</a></p>
<h1>Example 2</h1>
<h2></h2>
<p><strong>Headers</strong></p>
<p>MIME-Version: 1.0</p>
<p>From: Foo &lt;foo@bar.com&gt;</p>
<p>Subject: Test mail</p>
<p>Content-Type: multipart/alternative;boundary=np4f377521487cd</p>
<p><strong>Body</strong></p>
<p>This is a MIME encoded message.</p>
<p>&nbsp;</p>
<p>&#8211;np4f377521487cd</p>
<p>Content-type: text/plain;charset=utf-8</p>
<p>&nbsp;</p>
<p>This is the text/plain version.</p>
<p>&nbsp;</p>
<p>&#8211;np4f377521487cd</p>
<p>Content-type: text/html;charset=utf-8</p>
<p>&nbsp;</p>
<p>This is the &lt;b&gt;text/html&lt;/b&gt; version.</p>
<p>&nbsp;</p>
<p>&#8211;np4f377521487cd&#8211;</p>
<div align="center">
<hr align="center" noshade="noshade" size="2" width="100%" />
</div>
<p>&lt;?php</p>
<p>&nbsp;</p>
<p>$boundary = <a title="PHP: uniqid - Manual" href="http://www.php.net/uniqid" onclick="pageTracker._trackPageview('/outgoing/www.php.net/uniqid?referer=');">uniqid</a>(&#8216;np&#8217;);</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>$headers = &#8220;MIME-Version: 1.0\r\n&#8221;;</p>
<p>$headers .= &#8220;From: Foo &lt;foo@bar.com&gt;\r\n&#8221;;</p>
<p>$headers .= &#8220;Subject: Test mail\r\n&#8221;;</p>
<p>$headers .= &#8220;Content-Type: multipart/alternative;boundary=&#8221; . $boundary . &#8220;\r\n&#8221;;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>$message = &#8220;This is a MIME encoded message.&#8221;;</p>
<p>&nbsp;</p>
<p>$message .= &#8220;\r\n\r\n&#8211;&#8221; . $boundary . &#8220;\r\n&#8221;;</p>
<p>$message .= &#8220;Content-type: text/plain;charset=utf-8\r\n\r\n&#8221;;</p>
<p>$message .= &#8220;This is the text/plain version.&#8221;;</p>
<p>&nbsp;</p>
<p>$message .= &#8220;\r\n\r\n&#8211;&#8221; . $boundary . &#8220;\r\n&#8221;;</p>
<p>$message .= &#8220;Content-type: text/html;charset=utf-8\r\n\r\n&#8221;;</p>
<p>$message .= &#8220;This is the &lt;b&gt;text/html&lt;/b&gt; version.&#8221;;</p>
<p>&nbsp;</p>
<p>$message .= &#8220;\r\n\r\n&#8211;&#8221; . $boundary . &#8220;&#8211;&#8221;;</p>
<p>&nbsp;</p>
<p>//mail(&#8216;bar@foo.com&#8217;, &#8216;Test mail&#8217;, $message, $headers);</p>
<p>&nbsp;</p>
<p>?&gt;</p>
<p>&nbsp;</p>
<pre><code><a href="http://krijnhoetmer.nl/stuff/php/html-plain-text-mail/" onclick="pageTracker._trackPageview('/outgoing/krijnhoetmer.nl/stuff/php/html-plain-text-mail/?referer=');">http://krijnhoetmer.nl/stuff/php/html-plain-text-mail/</a></code></pre>
]]></content:encoded>
			<wfw:commentRss>http://kinghei.com/2011/12/20/send-a-multipart-email-both-html-and-plain-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Iframes and jQuery &#8211; Working with an iframe&#8217;s parent</title>
		<link>http://kinghei.com/2011/12/19/iframes-and-jquery-working-with-an-iframes-parent/</link>
		<comments>http://kinghei.com/2011/12/19/iframes-and-jquery-working-with-an-iframes-parent/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 04:36:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://kinghei.com/?p=458</guid>
		<description><![CDATA[Access parent windows within iframe using jQuery. e.g. &#60;script type=&#8221;text/javascript&#8221;&#62; p=window.parent; p.$(&#8216;#select2&#8242;).append(&#8216;&#60;option value=\&#8221;$matches[1],$matches[2]\&#8221;&#62;&#38;lt; $matches[1] &#38;gt; $matches[2]&#60;/option&#62;&#8217;); &#60;/script&#62;]]></description>
			<content:encoded><![CDATA[<p>Access parent windows within iframe using jQuery.</p>
<p>e.g.</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;</p>
<p>p=window.parent;</p>
<p>p.$(&#8216;#select2&#8242;).append(&#8216;&lt;option value=\&#8221;$matches[1],$matches[2]\&#8221;&gt;&amp;lt; $matches[1] &amp;gt; $matches[2]&lt;/option&gt;&#8217;);</p>
<p>&lt;/script&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://kinghei.com/2011/12/19/iframes-and-jquery-working-with-an-iframes-parent/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery &#8211; get element by id, class, name</title>
		<link>http://kinghei.com/2011/12/15/jquery-get-element-by-id-class-name/</link>
		<comments>http://kinghei.com/2011/12/15/jquery-get-element-by-id-class-name/#comments</comments>
		<pubDate>Thu, 15 Dec 2011 11:23:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://kinghei.com/?p=454</guid>
		<description><![CDATA[In jQuery, you can get elements with CSS class name and id easily. For example, 1. ID: #id $(‘#idA’) – selects all elements that have an id of ‘idA’, regardless of its tag name. $(‘div#idA’) – selects all div elements that has an id of ‘idA’. 2. Class: .classname $(‘.classA’) – selects all elements that have an class [...]]]></description>
			<content:encoded><![CDATA[<p>In jQuery, you can get elements with CSS class name and id easily.</p>
<p>For example,</p>
<h4>1. ID: #id</h4>
<ul>
<li><strong>$(‘#idA’)</strong> – selects all elements that have an id of ‘idA’, regardless of its tag name.</li>
<li><strong>$(‘div#idA’)</strong> – selects all div elements that has an id of ‘idA’.</li>
</ul>
<h4>2. Class: .classname</h4>
<ul>
<li><strong>$(‘.classA’)</strong> – selects all elements that have an class name of ‘classA’, regardless of its tag name.</li>
<li><strong>$(‘div.classA’)</strong> – selects all div elements that has an class name of ‘classA’.</li>
</ul>
<div>
<h4>3. Class: [name="value"]</h4>
<ul>
<li><strong>$(‘div[name^="nameA"]’)</strong> – selects all elements that have an name of ‘nameA’, regardless of its tag name.</li>
<li>e.g. [name*="value"], [name~="value"], [name$="value"]</li>
</ul>
<div>
<h4>3. Change attr: $(&#8216;#idA&#8217;).attr()</h4>
<ul>
<li><strong>$(&#8216;#idA&#8217;).attr(&#8216;src&#8217;, &#8216;value)</strong> – change value of attribute that have an idof ‘idA’, regardless of its tag name.</li>
</ul>
</div>
</div>
<h3>Full Example</h3>
<div></div>
<div>
<div>
<pre>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;jQuery Get element with class name and id&lt;/title&gt;

&lt;script type="text/javascript" src="jquery-1.3.2.min.js"&gt;&lt;/script&gt;

&lt;/head&gt;

&lt;script type="text/javascript"&gt;

$(document).ready(function(){

    var $element = $('.classABC').html();
    alert($element);

    var $element = $('#idABC').html();
    alert($element);

});

&lt;/script&gt;
&lt;body&gt;

&lt;h1&gt;jQuery Get element with class name and id&lt;/h1&gt;

	&lt;div class="classABC"&gt;
		This is belong to 'div'
	&lt;/div&gt;

	&lt;div id="idABC"&gt;
		This is belong to 'div id="idABC"'
	&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
<pre><a href="http://www.mkyong.com/jquery/jquery-how-to-get-element-with-css-class-name-and-id/" onclick="pageTracker._trackPageview('/outgoing/www.mkyong.com/jquery/jquery-how-to-get-element-with-css-class-name-and-id/?referer=');">http://www.mkyong.com/jquery/jquery-how-to-get-element-with-css-class-name-and-id/</a></pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://kinghei.com/2011/12/15/jquery-get-element-by-id-class-name/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

