Thanks! For example, mp3 files: file1.mp3, file2.mp3, file3.mp3 in the folder http://www.mydomain.com/mp3. How to specify it in the file below?
<?php
//path to directory to scan
$directory = dirname(__FILE__)."/";
//get all files in specified directory
$files = glob($directory . "*");
//print each file name
foreach($files as $file)
{
//check to see if the file is a folder/directory
if(is_file($file))
{
if(basename($file)!="list.php"){
?>
<a href="<?php echo basename($file); ?>"><?php echo basename($file); ?></a><br>
<?php
}
}
}
?>
What if the host (in my case Godaddy) protected and does not show the contents of folders?
Forbidden
You don’t have permission to access / books / on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
You mentioned that this issue was resolved, but it’s not true 🙂