directory listing

I have a code to create a simple directory, however it just isn’t doing all that I need it to do. Instead of just showing the first folder, I would like to show a plus sign if there are files in that directory, or a list of the files.

I am new to this, and just can’t figure out how to do this. Can someone help me with this code?

$path =("/myfiledirctory/");
$dir_handle = @opendir($path) or die(“Unable to open $path”);
while ($file = readdir($dir_handle)) {
if($file == “.” || $file == “…” || $file == “index.php” )
continue;
echo “<a href=”$file">$file
";
}
// Close
closedir($dir_handle);
?>

Sponsor our Newsletter | Privacy Policy | Terms of Service