Re: Readdir
| From: | Nicole Lallande | Date: | Thu, 01 Aug 2002 18:58:02 +0000 |
| Subject: | Re: Readdir | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-110726@lists.php.net to get a copy of this message | ||
Change:
echo "$file\n";
to:
echo "<a href='$file'>$file</a>\n";
Note the nested quotes -- outer quotes - ", inner quotes (around $file) single - '
Best,
Nicole
msmecca@mindspring.com wrote:
New To Php so please bear with me... :) I used the readdir function to read the files listed on a Apache server. And it worked fine. Now I would like to be able to get the files the php code returns, to be links. Where the user can click the file and download it. Also for the files to sit within a table or at least look neat on the page. http://www.optimus7.com/findme.php is the result I get from the php code below. Help! <?php if ($handle = opendir('/my/directory')) { echo "Directory handle: $handle\n"; echo "Files:\n"; while (false !== ($file = readdir($handle))) {-- ######################## Nicole Lallande nicole@nmlconsulting.com 760.753.6766 ########################echo "$file\n";} closedir($handle); } ?>