Hello,
I'm trying to use is_dir() to print a table of directories contained in a user directory. I want to skip the ./../ directories, which works as it should, and print the "valid directories" to the page as links but when I have say... three directories to output as links, I only get two of them, and they are all the same link i.e., directory. Also, the table cell containing the name of the directory is not output. I'm new to is_dir(), so if you can offer any help I would really appreciate it.
/*
function display_folders()
{
$userfolder = $_SESSION['valid_user'] . '/';
echo '<table border="1" cellpadding="5">';
$dir = 'members/' . $userfolder;
$files = scandir($dir);
foreach($files as $value) {
if(in_array($value, array('.', '..'))) { continue; }
// check for folders
if(is_dir($dir.DIRECTORY_SEPARATOR.$value)) {
printf('<tr><td><a href="photos.php?pa=%s">'.
'<img src="images/files.gif" width=75" height="75 />'.
'<a/></td><td>%s</td></tr>',
$value, $value);
}
}
echo '</table>';
}
*/
Thanks,
Jason