<?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>Chakkrit Tantithamthavorn&#039;s Official Personal Website &#187; php</title>
	<atom:link href="http://www.klainfo.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.klainfo.com</link>
	<description></description>
	<lastBuildDate>Wed, 01 Feb 2012 13:12:31 +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>CodeIgniter Routes Trick &#8211; Removing Controller Names from the URI to Keep URLs Short.</title>
		<link>http://www.klainfo.com/2010/02/03/codeigniter-routes-trick-removing-controller-names-from-the-uri-to-keep-urls-short/</link>
		<comments>http://www.klainfo.com/2010/02/03/codeigniter-routes-trick-removing-controller-names-from-the-uri-to-keep-urls-short/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 11:13:21 +0000</pubDate>
		<dc:creator>klainfo</dc:creator>
				<category><![CDATA[codeIgniter]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[route]]></category>

		<guid isPermaLink="false">http://blog.klainfo.com/?p=640</guid>
		<description><![CDATA[ช่วงนี้ บริการจำพวก URL Shortener Service กำลังมาแรง เช่น bit.ly goog.gl  youtu.be fb.me เป็นต้น ผมก็อยากจะลองทำเวบพวกนี้ บน Codeigniter เหมือนกัน สำหรับคนที่เคยใช้ codeigniter จะรู้ว่าระบบ URI ของ CI จะต้องมีรูปแบบดังนี้ http://localhost/controller/function/parameters นั่นหมายถึง มันยาวมากเลย แต่ผมต้องการ http://localhost/parameters เลยอ่ะคับ ไปลอง Google เลยมาโน๊ตเก็บไว้หน่อย เด๋วพอจะใช้แล้วหาไม่เจออีก เปิดไฟล์ application/config/routes.php เติมคำสั่งนี้ลงไป $route['^(?!video&#124;url).*'] = &#8216;controller/function/$0&#8242;; คำอธิบาย หมายถึงให้ Route URI ที่ไม่ได้ขึ้นต้นด้วยคำว่า video หรือ url ไปที่ๆ ต้องการ ที่มา http://bizwidgets.biz/web-design/codeigniter-routes-trick-removing-controller-names-from-the-uri-to-keep-urls-short/]]></description>
			<content:encoded><![CDATA[<p>ช่วงนี้ บริการจำพวก URL Shortener Service กำลังมาแรง เช่น bit.ly goog.gl  youtu.be fb.me เป็นต้น ผมก็อยากจะลองทำเวบพวกนี้ บน Codeigniter เหมือนกัน สำหรับคนที่เคยใช้ codeigniter จะรู้ว่าระบบ URI ของ CI จะต้องมีรูปแบบดังนี้ http://localhost/controller/function/parameters นั่นหมายถึง มันยาวมากเลย แต่ผมต้องการ http://localhost/parameters เลยอ่ะคับ ไปลอง Google เลยมาโน๊ตเก็บไว้หน่อย เด๋วพอจะใช้แล้วหาไม่เจออีก</p>
<p>เปิดไฟล์ application/config/routes.php</p>
<p>เติมคำสั่งนี้ลงไป</p>
<p>$route['^(?!video|url).*'] = &#8216;controller/function/$0&#8242;;</p>
<p><strong>คำอธิบาย</strong> หมายถึงให้ Route URI ที่ไม่ได้ขึ้นต้นด้วยคำว่า video หรือ url ไปที่ๆ ต้องการ</p>
<p>ที่มา <a href="http://bizwidgets.biz/web-design/codeigniter-routes-trick-removing-controller-names-from-the-uri-to-keep-urls-short/">http://bizwidgets.biz/web-design/codeigniter-routes-trick-removing-controller-names-from-the-uri-to-keep-urls-short/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.klainfo.com/2010/02/03/codeigniter-routes-trick-removing-controller-names-from-the-uri-to-keep-urls-short/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] Delete Apache owned files and folders</title>
		<link>http://www.klainfo.com/2010/01/24/php-delete-apache-owned-files-and-folders/</link>
		<comments>http://www.klainfo.com/2010/01/24/php-delete-apache-owned-files-and-folders/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 05:22:55 +0000</pubDate>
		<dc:creator>klainfo</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[permission]]></category>

		<guid isPermaLink="false">http://blog.klainfo.com/?p=586</guid>
		<description><![CDATA[เนื่องจากผมใช้ Doku wiki แล้ว Apache มันสร้าง cache ขึ้นมาเอง แล้วผมอยากจะลบมัน ปรากฏว่าผมลบไฟล์ไม่ได้ เนื่องจากผมไม่ใช่ Root แล้วเป็นไฟล์ที่ Apache สร้างขึ้นด้วย นั่งขุดคุ้ยหา script php มาลบให้มันละกัน ทำตามนี้โลด 1 2 3 4 5 6 7 8 9 10 11 12 13 14 &#60;?php function SureRemoveDir&#40;$dir&#41; &#123; if&#40;!$dh = @opendir&#40;$dir&#41;&#41; return; while &#40;&#40;$obj = readdir&#40;$dh&#41;&#41;&#41; &#123; if&#40;$obj==‘.’ &#124;&#124; $obj==‘..’&#41; continue; if &#40;!@unlink&#40;$dir.‘/’.$obj&#41;&#41; &#123; SureRemoveDir&#40;$dir.‘/’.$obj&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p>เนื่องจากผมใช้ Doku wiki แล้ว Apache มันสร้าง cache ขึ้นมาเอง แล้วผมอยากจะลบมัน ปรากฏว่าผมลบไฟล์ไม่ได้ เนื่องจากผมไม่ใช่ Root แล้วเป็นไฟล์ที่ Apache สร้างขึ้นด้วย</p>
<p>นั่งขุดคุ้ยหา script php มาลบให้มันละกัน ทำตามนี้โลด</p>
<div class="wp_syntax">
<table>
<tr>
<td class="line_numbers">
<pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre>
</td>
<td class="code">
<pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> SureRemoveDir<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$dh</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">opendir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span>
      <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$obj</span> <span style="color: #339933;">=</span> <span style="color: #990000;">readdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dh</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$obj</span><span style="color: #339933;">==</span>‘<span style="color: #339933;">.</span>’ <span style="color: #339933;">||</span> <span style="color: #000088;">$obj</span><span style="color: #339933;">==</span>‘<span style="color: #339933;">..</span>’<span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!@</span><span style="color: #990000;">unlink</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span>‘<span style="color: #339933;">/</span>’<span style="color: #339933;">.</span><span style="color: #000088;">$obj</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
SureRemoveDir<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #339933;">.</span>‘<span style="color: #339933;">/</span>’<span style="color: #339933;">.</span><span style="color: #000088;">$obj</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
                   <span style="color: #000088;">$file_deleted</span><span style="color: #339933;">++;</span>
            <span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">@</span><span style="color: #990000;">rmdir</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$dir</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$dir_deleted</span><span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre>
</td>
</tr>
</table>
</div>
<p>วิธีเรียกใช้ก็ง่ายๆ ตามนี้เลยครับ โดยใส่ชื่อ Directory ลงไปแทนคำว่า Test</p>
<p>เสร็จแล้ว เย่ๆ ^^</p>
]]></content:encoded>
			<wfw:commentRss>http://www.klainfo.com/2010/01/24/php-delete-apache-owned-files-and-folders/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Served from: www.klainfo.com @ 2012-02-06 19:30:53 -->
