現在、ユーザーがディレクトリ内のファイルを表示できるようにするスクリプトがあります。これらのファイルもダウンロード可能にする方法を考えています。index.php と関係があると思いますが、よくわかりません。私のスクリプトを以下に示します。
<?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 "<a href=\"$file\">$file</a><br />";
}
// Close
closedir($dir_handle);
?>