Forum Moderators: coopster
- reads in all the files in a particular directory
- displays the file names in a html list and makes a link of them:
<ul>
<li><a href="filelocation1">filename 1</li>
<li><a href="filelocation2">filename 1</li>
<li><a href="filelocation3">filename 1</li>
</ul>
etc.?
So basically it creates a list of links with the contents in that directory,
so you can download them from there.
TIA.
and do something like
//------------
<ul>
<?php
$dir = '/my_directory_location';
$files = scandir($dir);
foreach($files as $ind_file){
?>
<li><a href="<?php echo $dir."/".$ind_file;?>"><?php echo $ind_file;?></li>
<?php
}
?>
</ul>
//-----------
I aint tested it so may need some tweaking.
Ally
$dir = opendir('files/');
echo '<ul>';while ($read = readdir($dir))
{if ($read!='.' && $read!='..')
{
echo '<li><a href="files/'.$read.'">'.$read.'</a></li>';
}}
echo '</ul>';
closedir($dir);
dc