Creating a list en print it on screen Creating a list en print it on screen
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Creating a list en print it on screen

Started by Eazy-D, January 25, 2005, 07:09:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Eazy-D

Hi,

I've added a new link in the topmenu ("Music").  When you click on music, their must appear a list of Mp3 files wich are in a directory on my webspace. Just like you click on "FAQ", their appears a list with faq, but when I click on my "Music" link, a list of mp3 files must apear.  It would be very easy in use when the list of mp3 is build up of all the mp3 files of the directory i keep them in....

When you click on the button "music", the file "music.php" already loads....in "music.php" the list must be created and printed to the screen.

I still haven't found a solution the build such a list.... and to print that list on screen..

Any brain can help me?  

Thanx in Advanced!!

Nibbler

I don't see what this has to do with coppermine.


<?
$dir = '/path/to/your/music/';

if (is_dir($dir)) {
    if ($dh = opendir($dir)) {
        while (($file = readdir($dh)) !== false) {
            if (substr($file, strlen($file)-4) == '.mp3') echo "$file<br />";
        }
        closedir($dh);
    }
}