Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Creating a list en print it on screen  (Read 2552 times)

0 Members and 1 Guest are viewing this topic.

Eazy-D

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
Creating a list en print it on screen
« on: January 25, 2005, 07:09:03 pm »

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!!
Logged

Nibbler

  • Guest
Re: Creating a list en print it on screen
« Reply #1 on: January 25, 2005, 07:42:50 pm »

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

Code: [Select]
<?
$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);
    }
}
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 19 queries.