I'm building a web application using PHP to play my mp3z. My first
step is to just list the albums that I have. Each album is a folder
on my hard drive. The problem I am having is that I'm trying to list
these folders from a different drive.
For instance:
-----------------------
<?php
$dir = "/";
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if ($file != "." && $file != "..") {
echo "$file";?><br>< ?
}
}
closedir($dh);
}
}
?>
-------------------------
Displays:
AUTOEXEC.BAT
boot.ini
CONFIG.SYS
Documents and Settings
eclipse
..
..
..
--------------------------
-> The above code shows me that the root directory is the contents in
my C drive. I have organized my hard drive to keep my music in a
different partition. (M:).
So my question is, how can I list the files in my M: (which contains
my music albums)???
Thanks!
step is to just list the albums that I have. Each album is a folder
on my hard drive. The problem I am having is that I'm trying to list
these folders from a different drive.
For instance:
-----------------------
<?php
$dir = "/";
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if ($file != "." && $file != "..") {
echo "$file";?><br>< ?
}
}
closedir($dh);
}
}
?>
-------------------------
Displays:
AUTOEXEC.BAT
boot.ini
CONFIG.SYS
Documents and Settings
eclipse
..
..
..
--------------------------
-> The above code shows me that the root directory is the contents in
my C drive. I have organized my hard drive to keep my music in a
different partition. (M:).
So my question is, how can I list the files in my M: (which contains
my music albums)???
Thanks!
Comment