note 64480 added to function.opendir
| From: | tozeiler at osu1 dot php dot net | Date: | Sat, 15 Apr 2006 08:34:58 +0000 |
| Subject: | note 64480 added to function.opendir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-108136@lists.php.net to get a copy of this message | ||
"opendir" said:
------------------------------------------------------------------
23-Jan-2006 08:04
I Just wanted a directory list and a clickable link to download the files
<snip>
------
<?
echo ("<h1>Directory Overzicht:</h1>");
function getFiles($path) {
<snip complicated function contents>
------------------------------------------------------------------
Here's a more straightforward way to linkify $path/files:
<?php
echo "<h1>Directory Overzicht:</h1>";
$dh = opendir($path);
while (($file = readdir($dh)) !== false) {
echo "<a href='$path/$file'>$file</a><br />";
}
closedir($dh);
?>
----
Server IP: 216.194.113.175
Probable Submitter: 216.186.53.195
----
X-Spam-Status: No, hits=3.3 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HTML_MESSAGE autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.opendir.php
Edit -- http://master.php.net/note/edit/64480
Del: integrated -- http://master.php.net/note/delete/64480/integrated
Del: useless -- http://master.php.net/note/delete/64480/useless
Del: bad code -- http://master.php.net/note/delete/64480/bad+code
Del: spam -- http://master.php.net/note/delete/64480/spam
Del: non-english -- http://master.php.net/note/delete/64480/non-english
Del: in docs -- http://master.php.net/note/delete/64480/in+docs
Del: other reasons-- http://master.php.net/note/delete/64480
Reject -- http://master.php.net/note/reject/64480
Search -- http://master.php.net/manage/user-notes.php