<?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>i-keng.com &#187; PHP</title>
	<atom:link href="http://www.i-keng.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.i-keng.com</link>
	<description>free php scripts ajax web resource</description>
	<lastBuildDate>Sun, 29 Aug 2010 08:59:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>WYSIWYG Editor With A File Manager: elRTE</title>
		<link>http://www.i-keng.com/2010/08/29/wysiwyg-editor-with-a-file-manager-elrte/</link>
		<comments>http://www.i-keng.com/2010/08/29/wysiwyg-editor-with-a-file-manager-elrte/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 08:59:20 +0000</pubDate>
		<dc:creator>i-keng</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[rich text editor]]></category>
		<category><![CDATA[text editor]]></category>
		<category><![CDATA[WYSIWYG]]></category>

		<guid isPermaLink="false">http://www.i-keng.com/?p=182</guid>
		<description><![CDATA[elRTE is an open source and feature-rich WYSIWYG editor that is built using jQuery UI. It performs all standard functions of an editor and has all the extras like undo-redo, advanced table management, creating a custom HTML element with a custom style + inserting it quickly and more. The interface is controlled via a single [...]]]></description>
			<content:encoded><![CDATA[<p>elRTE is an open source and feature-rich WYSIWYG editor that is built using jQuery UI.</p>
<p>It performs all standard functions of an editor and has all the extras like undo-redo, advanced table management, creating a custom HTML element with a custom style + inserting it quickly and more.</p>
<p><img class="aligncenter" title="WYSIWYG" src="http://images.i-keng.com/images/screenshot.png" alt="" width="450" height="260" /></p>
<p><span id="more-182"></span></p>
<p>The interface is controlled via a single CSS file and can be customized pretty easily.</p>
<p>It has a <strong>built-in &#8220;save&#8221; button</strong> which can be  attached to a JS function that saves the content that is pretty useful  for helping users not to lose their content.</p>
<p><strong>elRTE</strong> can be integrated with any file manager, however, there is <a href="http://elrte.org/elfinder" target="_blank">elFinder</a>, a file manager that has ready-to-use integration (can be used standalone too).</p>
<p><strong>Website:</strong> <a href="http://elrte.org/" target="_blank">http://elrte.org/</a><br />
<strong>Demo:</strong> <a href="http://elrte.org/demo" target="_blank">http://elrte.org/demo</a><br />
<strong>Download:</strong> <a href="http://sourceforge.net/projects/elrte/files/" target="_blank">http://sourceforge.net/projects/elrte/files/</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2010/08/29/wysiwyg-editor-with-a-file-manager-elrte/" target="_blank"><img src="http://www.i-keng.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2010/08/29/wysiwyg-editor-with-a-file-manager-elrte/" target="_blank" title="Share on Facebook">Share on Facebook</a></p><div style='display:none' id="post-refEl-182"></div>]]></content:encoded>
			<wfw:commentRss>http://www.i-keng.com/2010/08/29/wysiwyg-editor-with-a-file-manager-elrte/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AeroSQL : Web-Based Multiple MySQL Manager</title>
		<link>http://www.i-keng.com/2010/04/07/aerosql-web-based-multiple-mysql-manager/</link>
		<comments>http://www.i-keng.com/2010/04/07/aerosql-web-based-multiple-mysql-manager/#comments</comments>
		<pubDate>Tue, 06 Apr 2010 17:57:47 +0000</pubDate>
		<dc:creator>i-keng</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[MySQL Management Tool]]></category>
		<category><![CDATA[MySQL Manager]]></category>

		<guid isPermaLink="false">http://www.i-keng.com/?p=165</guid>
		<description><![CDATA[AeroSQL is an open source web application, for managing MySQL databases. It can control databases from different servers in a single, desktop-like interface where records can be easily browsed or edited within a grid. The application displays every query executed &#38; can run a batch of sql queries to save you time. It is possible [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.burlaca.com/aerosql/" target="_blank"><strong>AeroSQL</strong></a> is an <strong>open source</strong> web application, for <strong>managing MySQL databases</strong>.</p>
<p>It can <strong>control databases from different servers</strong> in a single, <strong>desktop-like interface</strong> where records can be easily browsed or edited within a grid.</p>
<p><a href="http://www.i-keng.com/wp-content/uploads/2010/04/aerosql.gif"><img class="aligncenter size-full wp-image-166" title="aerosql" src="http://www.i-keng.com/wp-content/uploads/2010/04/aerosql.gif" alt="" width="480" height="187" /></a><span id="more-165"></span></p>
<p>The application displays every query executed &amp; can run a batch of sql queries to save you time.</p>
<p>It is possible to <strong>select the columns to be displayed</strong> while editing a table which will help reaching the data in an organized way.</p>
<p><strong>AeroSQL</strong> is <strong>built with PHP &amp; uses ExtJS</strong> to provide the desktop-like functionality.</p>
<p><strong>Website:</strong> <a href="http://www.burlaca.com/aerosql/" target="_blank">http://www.burlaca.com/aerosql/</a><br />
<strong>Demo:</strong> <a href="http://www.burlaca.com/aerosql-demo/" target="_blank">http://www.burlaca.com/aerosql-demo/</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2010/04/07/aerosql-web-based-multiple-mysql-manager/" target="_blank"><img src="http://www.i-keng.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2010/04/07/aerosql-web-based-multiple-mysql-manager/" target="_blank" title="Share on Facebook">Share on Facebook</a></p><div style='display:none' id="post-refEl-165"></div>]]></content:encoded>
			<wfw:commentRss>http://www.i-keng.com/2010/04/07/aerosql-web-based-multiple-mysql-manager/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>xmoovStream &#8211; Opensource PHP Streaming</title>
		<link>http://www.i-keng.com/2010/01/12/xmoovstream-opensource-php-streaming/</link>
		<comments>http://www.i-keng.com/2010/01/12/xmoovstream-opensource-php-streaming/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 07:31:49 +0000</pubDate>
		<dc:creator>i-keng</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[php Streaming]]></category>
		<category><![CDATA[PHP Streaming Server]]></category>
		<category><![CDATA[straming server]]></category>
		<category><![CDATA[xmoovStream]]></category>

		<guid isPermaLink="false">http://www.i-keng.com/?p=122</guid>
		<description><![CDATA[xmoovStream Server is an open source http streaming server built with PHP. It creates a layer between the web &#38; your files to provide you control over them in many ways like: stream Flash videos force file downloads logging of every action hot link protection hide original file locations bandwidth throttling &#38; burst loading &#38; [...]]]></description>
			<content:encoded><![CDATA[<p><strong>xmoovStream Server</strong> is an <strong>open source http streaming server</strong> built with <strong>PHP</strong>.</p>
<div style="text-align: center;"><img class="size-full wp-image-123  aligncenter" title="xmoovStream" src="http://www.i-keng.com/wp-content/uploads/2010/01/xmoovStream.png" alt="" width="400" height="225" /></div>
<p><span id="more-122"></span><br />
It creates a layer between the web &amp; your files to provide you control over them in many ways like:</p>
<ul>
<li>stream Flash videos</li>
<li>force file downloads</li>
<li>logging of every action</li>
<li>hot link protection</li>
<li>hide original file locations</li>
<li>bandwidth throttling &amp; burst loading</li>
<li>&amp; more..</li>
</ul>
<p><strong>xmoovStream</strong> is a <strong>centralized server</strong> which can manage different kinds of content from different urls under a single installation.</p>
<p>Like mentioned, it is not limited to streaming Flash videos, it can simply <strong>stream any file type</strong> including the video player itself or a thumbnail.</p>
<p>The server also <strong>comes with a lightweight video player &amp; an audio player</strong> for streaming your content.</p>
<p><strong>P.S.</strong> The resource is free for non-commercial website &amp; requires a license for any other usage.</p>
<p><strong>Website:</strong> <a href="http://stream.xmoov.com/" target="_blank">http://stream.xmoov.com/</a><br />
<strong>Demo:</strong> <a href="http://stream.xmoov.com/examples/" target="_blank">http://stream.xmoov.com/examples/</a><br />
<strong>Download:</strong> <a href="http://stream.xmoov.com/download/" target="_blank">http://stream.xmoov.com/download/</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2010/01/12/xmoovstream-opensource-php-streaming/" target="_blank"><img src="http://www.i-keng.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2010/01/12/xmoovstream-opensource-php-streaming/" target="_blank" title="Share on Facebook">Share on Facebook</a></p><div style='display:none' id="post-refEl-122"></div>]]></content:encoded>
			<wfw:commentRss>http://www.i-keng.com/2010/01/12/xmoovstream-opensource-php-streaming/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Stunning Web-Based File Manager: Mollify</title>
		<link>http://www.i-keng.com/2010/01/04/stunning-web-based-file-manager-mollify/</link>
		<comments>http://www.i-keng.com/2010/01/04/stunning-web-based-file-manager-mollify/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 16:18:27 +0000</pubDate>
		<dc:creator>i-keng</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[osx style]]></category>
		<category><![CDATA[php gwt]]></category>
		<category><![CDATA[php list directory]]></category>

		<guid isPermaLink="false">http://www.i-keng.com/?p=114</guid>
		<description><![CDATA[Mollify is an open source web-based file manager, built with PHP &#38; GWT, that can control files hosted in a web server or hosting account. It has a simple, intuitive &#38; Ajaxed interface that also supports multiple languages. The application is multi-user (users &#38; user-groups) where a file-level access can be set. File actions &#38; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.jaervelae.com/mollify/" target="_blank"><strong>Mollify</strong></a> is an <strong>open source web-based file manager</strong>, built with <strong>PHP &amp; GWT</strong>, that can control files hosted in a web server or hosting account.</p>
<p>It has a <strong>simple, intuitive &amp; Ajaxed interface</strong> that also supports multiple languages.</p>
<p style="text-align: right;"><img class="aligncenter size-full wp-image-115" title="mollify" src="http://www.i-keng.com/wp-content/uploads/2010/01/mollify.jpg" alt="mollify" width="480" height="201" /></p>
<p><span id="more-114"></span></p>
<p>The application is <strong>multi-user (users &amp; user-groups)</strong> where a file-level access can be set.</p>
<p>File actions &amp; directory actions can be completed quickly from context popup menus. It is also possible to <strong>download files/folders in zipped format</strong>.</p>
<p><strong>Mollify</strong> can <strong>upload multiple files</strong> at once &amp; enables to list the contents with <strong>sortable columns</strong>.</p>
<p>A unique feature offered is the <strong>ability to define aliases for folders</strong> in order to hide the real folder structure for security purposes.</p>
<p>The interface is totally <strong>customizable with CSS</strong>. Also, integration of the application with other products is possible as the frontend &amp; backends are independent (they communicate with HTTP/JSON).</p>
<p><strong>Website:</strong> <a href="Website: http://www.jaervelae.com/mollify/ Demo: http://www.jaervelae.com/mollify/demo.php Download: http://www.jaervelae.com/mollify/download.php" target="_blank">http://www.jaervelae.com/mollify/<br />
</a> <strong>Demo:</strong> <a href="http://www.jaervelae.com/mollify/demo.php" target="_blank">http://www.jaervelae.com/mollify/demo.php<br />
</a> <strong>Download:</strong> <a href="http://www.jaervelae.com/mollify/download.php" target="_blank">http://www.jaervelae.com/mollify/download.php</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2010/01/04/stunning-web-based-file-manager-mollify/" target="_blank"><img src="http://www.i-keng.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2010/01/04/stunning-web-based-file-manager-mollify/" target="_blank" title="Share on Facebook">Share on Facebook</a></p><div style='display:none' id="post-refEl-114"></div>]]></content:encoded>
			<wfw:commentRss>http://www.i-keng.com/2010/01/04/stunning-web-based-file-manager-mollify/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>การแบ่งหน้าด้วย PHP (PHP Paging)</title>
		<link>http://www.i-keng.com/2009/09/26/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%81%e0%b8%9a%e0%b9%88%e0%b8%87%e0%b8%ab%e0%b8%99%e0%b9%89%e0%b8%b2%e0%b8%94%e0%b9%89%e0%b8%a7%e0%b8%a2-php-php-paging/</link>
		<comments>http://www.i-keng.com/2009/09/26/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%81%e0%b8%9a%e0%b9%88%e0%b8%87%e0%b8%ab%e0%b8%99%e0%b9%89%e0%b8%b2%e0%b8%94%e0%b9%89%e0%b8%a7%e0%b8%a2-php-php-paging/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 17:22:24 +0000</pubDate>
		<dc:creator>i-keng</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[php paging]]></category>
		<category><![CDATA[การแบ่งหน้าด้วย php]]></category>

		<guid isPermaLink="false">http://www.i-keng.com/?p=68</guid>
		<description><![CDATA[วิธีการแบ่งหน้าด้วย PHP ให้ออกมาในรูปแบบดังนี้ [First page] &#60;&#60; Previous &#124; Page: &#8230; 2 3 4 5 6 &#8230; &#124; Next &#62;&#62; [Last page] วิธีใช้งาน &#60;? echo displayPaging( $total, $limit, $pagenumber, $baseurl ); /* $total = จำนวนข้อมูลทั้งหมด $limit = จำนวนข้อมูลต่อ 1 หน้า $pagenumber = เลขหน้าปัจจุบัน $baseurl = Parameter ต่าง ๆ แต่ Parameter สุดท้ายต้องเป็น page= ตัวอย่าง displayPaging( 100, 20, [...]]]></description>
			<content:encoded><![CDATA[<p>วิธีการแบ่งหน้าด้วย PHP ให้ออกมาในรูปแบบดังนี้</p>
<p>[First page] &lt;&lt; Previous | Page: &#8230; 2 3 4 5 6 &#8230; | Next &gt;&gt; [Last page]</p>
<p>วิธีใช้งาน</p>
<pre class="brush: php">
&lt;?
echo displayPaging( $total, $limit, $pagenumber, $baseurl );
/*
$total = จำนวนข้อมูลทั้งหมด
$limit = จำนวนข้อมูลต่อ 1 หน้า
$pagenumber = เลขหน้าปัจจุบัน
$baseurl = Parameter ต่าง ๆ แต่ Parameter สุดท้ายต้องเป็น page=
ตัวอย่าง displayPaging( 100, 20, 4, &quot;?keyword=เก่ง&amp;page=&quot;);
*/
?&gt;
</pre>
<p>ตัว Function อยู่ด้านในนะจ๊ะ&#8230;</p>
<p>ตัว Function</p>
<pre class="brush: php">
&lt;?
function displayPaging( $total, $limit, $pagenumber, $baseurl ){
// how many page numbers to show in list at a time
$showpages = &quot;10&quot;; // 1,3,5,7,9...

// set up icons to be used
$icon_path = &#039;icons/&#039;;
$icon_param = &#039;align=&quot;middle&quot; style=&quot;border:0px;&quot; &#039;;
$icon_first= &#039;[First page]&#039;;
$icon_last= &#039;[Lastpage]&#039;;
$icon_previous= &#039;&lt;&lt; Previous&#039;;
$icon_next= &#039;Next &gt;&gt;&#039;;
///////////////////
///////////////////

// do calculations
$pages = ceil($total / $limit);
$offset = ($pagenumber * $limit) - $limit;
$end = $offset + $limit;

// prepare paging links
$html .= &#039;&lt;div id=&quot;pageLinks&quot;&gt;&#039;;
// if first link is needed
if($pagenumber &gt; 1) { $previous = $pagenumber -1;
$html .= &#039;&lt;a href=&quot;&#039;.$baseurl.&#039;1&quot;&gt;&#039;.$icon_first.&#039;&lt;/a&gt; &#039;;
}
// if previous link is needed
if($pagenumber &gt; 2) { $previous = $pagenumber -1;
$html .= &#039;&lt;a href=&quot;&#039;.$baseurl.&#039;&#039;.$previous.&#039;&quot;&gt;&#039;.$icon_previous.&#039;&lt;/a&gt; &#039;;
}
// print page numbers
if ($pages&gt;=2) { $p=1;
$html .= &quot;| Page: &quot;;
$pages_before = $pagenumber - 1;
$pages_after = $pages - $pagenumber;
$show_before = floor($showpages / 2);
$show_after = floor($showpages / 2);
if ($pages_before &lt; $show_before){
$dif = $show_before - $pages_before;
$show_after = $show_after + $dif;
}
if ($pages_after &lt; $show_after){
$dif = $show_after - $pages_after;
$show_before = $show_before + $dif;
}
$minpage = $pagenumber - ($show_before+1);
$maxpage = $pagenumber + ($show_after+1);

if ($pagenumber &gt; ($show_before+1) &amp;&amp; $showpages &gt; 0) {
$html .= &quot; ... &quot;;
}
while ($p &lt;= $pages) {
if ($p &gt; $minpage &amp;&amp; $p &lt; $maxpage) {
if ($pagenumber == $p) {
$html .= &quot; &lt;b&gt;&quot;.$p.&quot;&lt;/b&gt;&quot;;
} else {
$html .= &#039; &lt;a href=&quot;&#039;.$baseurl.$p.&#039;&quot;&gt;&#039;.$p.&#039;&lt;/a&gt;&#039;;
}
}
$p++;
}
if ($maxpage-1 &lt; $pages &amp;&amp; $showpages &gt; 0) {
$html .= &quot; ... &quot;;
}
}
// if next link is needed
if($end &lt; $total) { $next = $pagenumber +1;
if ($next != ($p-1)) {
$html .= &#039; | &lt;a href=&quot;&#039;.$baseurl.$next.&#039;&quot;&gt;&#039;.$icon_next.&#039;&lt;/a&gt;&#039;;
} else {$html .= &#039; | &#039;;}
}
// if last link is needed
if($end &lt; $total) { $last = $p -1;
$html .= &#039; &lt;a href=&quot;&#039;.$baseurl.$last.&#039;&quot;&gt;&#039;.$icon_last.&#039;&lt;/a&gt;&#039;;
}
$html .= &#039;&lt;/div&gt;&#039;;
// return paging links
return $html;
}
?&gt;
</pre>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2009/09/26/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%81%e0%b8%9a%e0%b9%88%e0%b8%87%e0%b8%ab%e0%b8%99%e0%b9%89%e0%b8%b2%e0%b8%94%e0%b9%89%e0%b8%a7%e0%b8%a2-php-php-paging/" target="_blank"><img src="http://www.i-keng.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2009/09/26/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%81%e0%b8%9a%e0%b9%88%e0%b8%87%e0%b8%ab%e0%b8%99%e0%b9%89%e0%b8%b2%e0%b8%94%e0%b9%89%e0%b8%a7%e0%b8%a2-php-php-paging/" target="_blank" title="Share on Facebook">Share on Facebook</a></p><div style='display:none' id="post-refEl-68"></div>]]></content:encoded>
			<wfw:commentRss>http://www.i-keng.com/2009/09/26/%e0%b8%81%e0%b8%b2%e0%b8%a3%e0%b9%81%e0%b8%9a%e0%b9%88%e0%b8%87%e0%b8%ab%e0%b8%99%e0%b9%89%e0%b8%b2%e0%b8%94%e0%b9%89%e0%b8%a7%e0%b8%a2-php-php-paging/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Check external URL exists Using PHP</title>
		<link>http://www.i-keng.com/2009/09/26/check-target-url-exists/</link>
		<comments>http://www.i-keng.com/2009/09/26/check-target-url-exists/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 17:08:17 +0000</pubDate>
		<dc:creator>i-keng</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Check external URL exists Using PHP]]></category>
		<category><![CDATA[check url exists using php]]></category>
		<category><![CDATA[url exists]]></category>

		<guid isPermaLink="false">http://www.i-keng.com/?p=62</guid>
		<description><![CDATA[วิธีตรวจสอบว่า URL ปลายทางนั้นมีอยู่จริงรึป่าว ?? วิธีใช้งาน &#60;? echo url_exists(&#34;http://www.i-keng.com/images/i-keng.png&#34;); ?&#62; ตัว Function อยู่ด้านในนะจ๊ะ&#8230; ตัว Function &#60;? function url_exists($url){ $url = str_replace(&#34;http://&#34;, &#34;&#34;, $url); if (strstr($url, &#34;/&#34;)) { $url = explode(&#34;/&#34;, $url, 2); $url[1] = &#34;/&#34;.$url[1]; } else { $url = array($url, &#34;/&#34;); } $fh = fsockopen($url[0], 80); if ($fh) { fputs($fh,&#34;GET &#34;.$url[1].&#34; HTTP/1.1\nHost:&#34;.$url[0].&#34;\n\n&#34;); if (fread($fh, 22) [...]]]></description>
			<content:encoded><![CDATA[<p>วิธีตรวจสอบว่า URL ปลายทางนั้นมีอยู่จริงรึป่าว ??</p>
<p><span style="text-decoration: underline;"><strong>วิธีใช้งาน</strong></span></p>
<pre class="brush: php">
&lt;?
     echo url_exists(&quot;http://www.i-keng.com/images/i-keng.png&quot;);
?&gt;
</pre>
<p>ตัว Function อยู่ด้านในนะจ๊ะ&#8230;</p>
<p><span id="more-62"></span></p>
<p><strong><span style="text-decoration: underline;">ตัว Function </span></strong></p>
<pre class="brush: php">

&lt;?
     function url_exists($url){
         $url = str_replace(&quot;http://&quot;, &quot;&quot;, $url);
         if (strstr($url, &quot;/&quot;)) {
             $url = explode(&quot;/&quot;, $url, 2);
             $url[1] = &quot;/&quot;.$url[1];
         } else {
             $url = array($url, &quot;/&quot;);
         }
         $fh = fsockopen($url[0], 80);
         if ($fh) {
             fputs($fh,&quot;GET &quot;.$url[1].&quot; HTTP/1.1\nHost:&quot;.$url[0].&quot;\n\n&quot;);
             if (fread($fh, 22) == &quot;HTTP/1.1 404 Not Found&quot;) {
                 return FALSE;
             } else {
                 return true;   
             }
         } else {
             return false;
         }
     }
?&gt;
</pre>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2009/09/26/check-target-url-exists/" target="_blank"><img src="http://www.i-keng.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2009/09/26/check-target-url-exists/" target="_blank" title="Share on Facebook">Share on Facebook</a></p><div style='display:none' id="post-refEl-62"></div>]]></content:encoded>
			<wfw:commentRss>http://www.i-keng.com/2009/09/26/check-target-url-exists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>การใช้งาน fsockopen เชื่อมต่อ ไปหา Server ที่เป็น Tomcat และ Apache</title>
		<link>http://www.i-keng.com/2009/09/25/fsockopen-to-tomcat-server/</link>
		<comments>http://www.i-keng.com/2009/09/25/fsockopen-to-tomcat-server/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 14:47:53 +0000</pubDate>
		<dc:creator>i-keng</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[close connection when fsockopen]]></category>
		<category><![CDATA[cURL]]></category>
		<category><![CDATA[fsockopen]]></category>
		<category><![CDATA[fsockopen to tomcat]]></category>
		<category><![CDATA[fsockopen to tomcat server]]></category>
		<category><![CDATA[การใช้งาน cURL]]></category>
		<category><![CDATA[การใช้งาน fsockopen]]></category>
		<category><![CDATA[เปิด socket ไปหา tomcat]]></category>

		<guid isPermaLink="false">http://www.i-keng.com/?p=48</guid>
		<description><![CDATA[สืบเนื่องจากผมประสบปัญหาการใช้งาน fsockopen ที่เคย Connect ไปหา Server ที่เป็น Apache แต่ ณ.บัดนาว ต้องใช้งาน fsockopen Connect ไปหา Server ที่เป็น Tomcat ความบรรลัยจึงบังเกิด &#8230; โดยปกติแล้วนั้น เมื่อ ใช้งาน fsockopen Connect ไปหา Server ที่เป็น Apache นั้น มันจะต้ด Header ด้วย \r\n ดังนี้.. $ctrlf = &#34;\r\n&#34;; $header = &#34;POST /  HTTP/1.0&#34;.$ctrlf; $header .= &#34;Content-type: application/x-www-form-urlencoded&#34;.$ctrlf; $header .= &#34;Content-Length: &#34;.$contentlength.$ctrlf; $fp = fsockopen(&#34;www.example.com&#34;, 80, $errno, [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="alignnone size-full wp-image-59" title="php-apache-tomcat" src="http://www.i-keng.com/wp-content/uploads/2009/09/php-apache-tomcat.jpg" alt="php-apache-tomcat" width="365" height="218" /></p>
<p>สืบเนื่องจากผมประสบปัญหาการใช้งาน <a href="http://th2.php.net/manual/en/function.fsockopen.php" target="_blank">fsockopen</a> ที่เคย Connect ไปหา Server ที่เป็น Apache แต่ ณ.บัดนาว ต้องใช้งาน <a href="http://th2.php.net/manual/en/function.fsockopen.php" target="_blank">fsockopen</a> Connect ไปหา Server ที่เป็น Tomcat ความบรรลัยจึงบังเกิด &#8230;</p>
<p><span id="more-48"></span></p>
<p>โดยปกติแล้วนั้น เมื่อ ใช้งาน <a href="http://th2.php.net/manual/en/function.fsockopen.php" target="_blank">fsockopen</a> Connect ไปหา Server ที่เป็น Apache นั้น มันจะต้ด Header ด้วย <span style="color: #ff0000;">\r\n</span> ดังนี้..</p>
<pre class="brush: php">
$ctrlf = &quot;\r\n&quot;;
$header = &quot;POST /  HTTP/1.0&quot;.$ctrlf;
$header .= &quot;Content-type: application/x-www-form-urlencoded&quot;.$ctrlf;
$header .= &quot;Content-Length: &quot;.$contentlength.$ctrlf;
$fp = fsockopen(&quot;www.example.com&quot;, 80, $errno, $errstr, 30);
if ($fp){
fwrite($fp,$header.$ctrlf);
while (!feof($fp)) {
$tmp = fgets($fp, 200);
$response .= $tmp;
}
} else {
$response = &quot;Connection failed : &quot;.$errstr.&quot;(&quot;.$errno.&quot;)&lt;br /&gt;\n&quot;;
}
</pre>
<p>แต่่ด้วย Code เดียวกันนี้ ถ้า ใช้งาน <a href="http://th2.php.net/manual/en/function.fsockopen.php" target="_blank">fsockopen</a> ไปหา Server ที่เป็็น Tomcat นั้น Server จะ Close Connection ไปเลย เนื่องจาก<br />
<span style="color: #008000;">ถ้าใช้งาน <a href="http://th2.php.net/manual/en/function.fsockopen.php" target="_blank">fsockopen</a> ไปหา Server ที่เป็น Tomcat นั้น จะตัด Header ด้วย \n ตัวเดียวเท่านั้น..</span><span style="color: #ff0000;">(ทำไมไม่เสือกทำให้เหมือนกันวะ!!)</span><br />
Code ด้านบน จึงใช้งานเชื่อมต่อไปหา Server ที่เป็น Tomcat ไม่ได้ สาดด!!</p>
<p><span style="color: #ff6600;">เพราะฉะนั้นถ้าจะใช้งาน <a href="http://th2.php.net/manual/en/function.fsockopen.php" target="_blank">fsockopen</a> ไปหา Server ที่เป็น Tomcat เราจึงต้องเปลี่ยนการตัด Header จาก \r\n เป็น \n ดังนี้<br />
</span></p>
<pre class="brush: php">
$ctrlf = &quot;\n&quot;;
</pre>
<p>หรือมีอีก 1 วิธี คือใช้งาน <a href="http://th2.php.net/curl" target="_blank">cURL</a> ไปซะเลย ซึ่งวิธีนี้จะ Post ไปได้ทั้ง Server ที่เป็น Apache และ Tomcat ครับ ดังนี้</p>
<pre class="brush: php">
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, &quot;example.com&quot;);
curl_setopt($ch, CURLOPT_HTTPHEADER,array(&quot;Content-type: application/x-www-form-urlencoded&quot;));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, &quot;params=yourparameter&quot;);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
curl_close($ch);
</pre>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2009/09/25/fsockopen-to-tomcat-server/" target="_blank"><img src="http://www.i-keng.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2009/09/25/fsockopen-to-tomcat-server/" target="_blank" title="Share on Facebook">Share on Facebook</a></p><div style='display:none' id="post-refEl-48"></div>]]></content:encoded>
			<wfw:commentRss>http://www.i-keng.com/2009/09/25/fsockopen-to-tomcat-server/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Free image hosting script</title>
		<link>http://www.i-keng.com/2009/07/14/free-image-hosting-script/</link>
		<comments>http://www.i-keng.com/2009/07/14/free-image-hosting-script/#comments</comments>
		<pubDate>Tue, 14 Jul 2009 16:51:07 +0000</pubDate>
		<dc:creator>i-keng</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[free images scripts]]></category>
		<category><![CDATA[free images upload]]></category>
		<category><![CDATA[free imahes hosting scripts]]></category>
		<category><![CDATA[image upload]]></category>

		<guid isPermaLink="false">http://www.i-keng.com/?p=3</guid>
		<description><![CDATA[Easy to install and configure It installs quickly, requires no database and is configurable. You can determine the size of images, file length, etc.. More than image upload It allows you to resize images, verify the file integrity and integrate it with url shorteners like TinyURL, tr.im and Snurl. Demo : http://demo.chevereto.com/ Download : http://chevereto.com/download/ [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img src="http://www.i-keng.com/wp-content/uploads/2009/07/chevereto.jpg" border="0" alt="" /></p>
<p style="text-align: center;">
<p><span id="more-3"></span></p>
<h2>Easy to install and configure</h2>
<p>It installs quickly, requires no database and is configurable. You can determine the size of images, file length, etc..</p>
<h2>More than image upload</h2>
<p>It allows you to resize images, verify the file integrity and integrate it with url shorteners like TinyURL, tr.im and Snurl.</p>
<p><strong>Demo :</strong> <a href="http://demo.chevereto.com/" target="_blank">http://demo.chevereto.com/</a></p>
<p><strong>Download :</strong> <a href="http://chevereto.com/download/" target="_blank">http://chevereto.com/download/</a></p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2009/07/14/free-image-hosting-script/" target="_blank"><img src="http://www.i-keng.com/wp-content/plugins/add-to-facebook-plugin/facebook_share_icon.gif" alt="Share on Facebook" title="Share on Facebook" /></a><a href="http://www.facebook.com/share.php?u=http://www.i-keng.com/2009/07/14/free-image-hosting-script/" target="_blank" title="Share on Facebook">Share on Facebook</a></p><div style='display:none' id="post-refEl-3"></div>]]></content:encoded>
			<wfw:commentRss>http://www.i-keng.com/2009/07/14/free-image-hosting-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
