Hai
Im trying to make a link for mp3 file from some folders. How create a link for these mp3 files by using php code ?

Can you explain a bit more what you want ? Do you want to search your folders for mp3 files and show a list (with links) ?

Can you explain a bit more what you want ? Do you want to search your folders for mp3 files and show a list (with links) ?

yes , and automaticaly call all mp3 files from folder

Hai
Im trying to make a link for mp3 file from some folders. How create a link for these mp3 files by using php code ?

Yes I want all links of mp3 files

its not working
it shows this::::
Warning: opendir(tpl) [function.opendir]: failed to open dir: No such file or directory in /mp3links.php on line 2

That was just an example, I think you need to change 'tpl' to '.'

Hai
its working well. but a problum that it grab all file from folder like as html page, php page, gif, jpg etc...

<?php 
if ($handle = opendir('uploads')) {
    while (false !== ($file = readdir($handle))) { 
        if ($file != "." && $file != ".." && $file != ".DS_Store" && $file != "list.php") { 
            echo ("<a href=\"uploads/". $file ."\">$file</a><br />"); 
        } 
    }
    closedir($handle); 
}
echo "<br />";
?>

how can find only mp3 file or html page

help me please

Removing the first line (Content-disposition) will cause the browser to play the audio, if it is capable.

header('Content-disposition: attachment; filename=audio.mp3');
header('Content-type: audio/mp3');
readfile('/path/to/audio.mp3');