View and Dowload Files from Directory
<p>I currently have a script which allows users to view files within a directory.  I am wondering how I can make these files downloadable as well. I think it has something to do with the index.php but not sure.  Thought I best just check and clarify My script is below.</p>

<pre><code>        &lt;?php

$path = "/home/phpprac/assesment"; 


$dir_handle = @opendir($path) or die("Unable to open $path"); 


while ($file = readdir($dir_handle)) { 

if($file == "." || $file == ".." || $file == "index.php" ) 

    continue; 
    echo "&lt;a href=\"$file\"&gt;$file&lt;/a&gt;&lt;br /&gt;"; 

} 
// Close 
closedir($dir_handle); 
</code></pre>

<p>?></p>
