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

[EMAIL PROTECTED] 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))) { 
>        echo "$file\n";
>    }
>
>  
>    closedir($handle); 
>}
>?>
>

-- 
########################
Nicole Lallande
[EMAIL PROTECTED]
760.753.6766
########################




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to