Hello, I am starting to play with php and i got a webfolder where i get regulary new files. I'm looking for a command that reads out a directory and then displays the url that would be required to download the file.
<?php
$ordner = "./files";
$handle = opendir($ordner);
while ($file = readdir ($handle)) {
if($file != "." && $file != "..") {
if(is_dir($ordner."/".$file)) {
echo "/".$file."<br/>";
} else {
// kompletter Pfad
$compl = $ordner."/".$file;
echo "<a href=\"".$compl."\">".$file."</a><br/>";
}
}
}
closedir($handle);
?>
Thats what I produced up to know, it shows the name of the content and then on click one can download the file. I'm now looking for an additional feature that also displays the actual url.
I have no idea what kind of command could realize the idea may someone of you can help me?
Tobi