|
Posted by Martin Jay on 05/04/06 20:03
In message <4bunlmF1367ahU1@individual.net>, chlori <usenet314@arto.ch>
writes
>I would like to have a list of links on a website linking to the files in
>a given directory (each file has one link). This list should get updated
>when the files from that dir are edited (files added, removed, renamed,
>...) with a separate FTP-client. Is that possible?
Yes, and quite easy to do. Some web servers will display a list of all
files in a directory if that directory doesn't contain an 'index' file.
If you can run PHP files on your server you could use something like
this:
<?php
$dir=""; // Directory where files are stored
if ($dir_list = opendir($dir))
{
while(($filename = readdir($dir_list)) !== false)
{
?>
<p><a href="<?php echo $filename; ?>"><?php echo $filename;
?></a></p>
<?php
}
closedir($dir_list);
}
?>
--
Martin Jay
Navigation:
[Reply to this message]
|