<?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>IT Resource &#187; PHP</title>
	<atom:link href="http://www.itresource.com.au/category/programming/php-programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.itresource.com.au</link>
	<description>Your one stop Information Technology Resource</description>
	<lastBuildDate>Sun, 23 May 2010 03:53:38 +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: Display hyperlinked list of files in a directory</title>
		<link>http://www.itresource.com.au/2008/03/29/php-display-hyperlinked-list-of-files-in-a-directory/</link>
		<comments>http://www.itresource.com.au/2008/03/29/php-display-hyperlinked-list-of-files-in-a-directory/#comments</comments>
		<pubDate>Sat, 29 Mar 2008 11:12:52 +0000</pubDate>
		<dc:creator>Dave W</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.itresource.com.au/2008/03/29/php-display-hyperlinked-list-of-files-in-a-directory/</guid>
		<description><![CDATA[The code below will display a hyperlinked list of all the files contained in a specified folder. This is a very simple way to have your own directory browser. Simply copy the code below into a new notepad document and save it as browser.php. Now upload the file to somewhere on your web server and [...]]]></description>
			<content:encoded><![CDATA[<p>The code below will display a hyperlinked list of all the files contained in a specified folder. This is a very simple way to have your own directory browser. Simply copy the code below into a new notepad document and save it as <strong>browser.php</strong>. Now upload the file to somewhere on your web server and browse to it. You should see an index of all files in the directory of your webserver.</p>
<p><code style="white-space: nowrap"><code><span style="color: #000000"><span style="color: #0000bb">&lt;?php</span></span></code></code><span style="color: #ff8000"><br />
</span><span style="color: #0000bb">$pathÂ </span><span style="color: #007700">=Â </span><span style="color: #dd0000">&#8220;/home/username/public_html/folder/&#8221;</span><span style="color: #007700">;</span></p>
<p><span style="color: #ff8000"></span><span style="color: #0000bb">$dir_handleÂ </span><span style="color: #007700">=Â @</span><span style="color: #0000bb">opendir</span><span style="color: #007700">(</span><span style="color: #0000bb">$path</span><span style="color: #007700">)Â orÂ die(</span><span style="color: #dd0000">&#8220;UnableÂ toÂ openÂ $path&#8221;</span><span style="color: #007700">);</span></p>
<p><span style="color: #ff8000"></span><span style="color: #007700">whileÂ (</span><span style="color: #0000bb">$fileÂ </span><span style="color: #007700">=Â </span><span style="color: #0000bb">readdir</span><span style="color: #007700">(</span><span style="color: #0000bb">$dir_handle</span><span style="color: #007700">))Â {<br />
if(</span><span style="color: #0000bb">$fileÂ </span><span style="color: #007700">==Â </span><span style="color: #dd0000">&#8220;.&#8221;Â </span><span style="color: #007700">||Â </span><span style="color: #0000bb">$fileÂ </span><span style="color: #007700">==Â </span><span style="color: #dd0000">&#8220;..&#8221;Â </span><span style="color: #007700">||Â </span><span style="color: #0000bb">$fileÂ </span><span style="color: #007700">==Â </span><span style="color: #dd0000">&#8220;index.php&#8221;Â </span><span style="color: #007700">)<br />
continue;<br />
echoÂ </span><span style="color: #dd0000">&#8220;&lt;a href=\&#8221;$file\&#8221;&gt;$file&lt;/a&gt;&lt;brÂ /&gt;&#8221;</span><span style="color: #007700">;<br />
}</span></p>
<p><span style="color: #ff8000"></span><span style="color: #0000bb">closedir</span><span style="color: #007700">(</span><span style="color: #0000bb">$dir_handle</span><span style="color: #007700">);</span></p>
<p><span style="color: #0000bb">?&gt;</span></p>
<p>And there you have it!  A very simple way of creating a directory browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.itresource.com.au/2008/03/29/php-display-hyperlinked-list-of-files-in-a-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

