Thanks a lot for the help guys, I'm almost there. I'm now using the following code :-
Code:
// Define the full path to your folder from root
$path = "./mp3";
// Open the folder
$dir_handle = @opendir($path) or die("Unable to open $path");
// Loop through the files
while ($file = readdir($dir_handle)) {
if($file == "." || $file == ".." || $file == "index.php" )
continue;
$output .= "<a href=\"$file\">$file</a><br />";
}
// Close
closedir($dir_handle);
This is very close to what I want. My only issue now is the link displayed for each file is missing the folder they are in.
The link displayed is
Code:
www.example.com/file.mp3
The link i want displayed is
Code:
www.example.com/mp3/file.mp3
I'm having terrible trouble making this seemingly easy modification. Could some one help with this last hurdle please ? Thanks a lot for your time.