if(isset($_GET['dir'])){
$dirname = $_GET['dir'];
echo "
$dirname
";
$dh = opendir("/home/.diplomat/kyle_osborn/hbband.com/Pictures/$dirname") or die("couldn't open directory");
//open
echo '';
$rowcount = 0;
while (!(($file = readdir($dh)) == false)) {
if (!(strstr("$file", "..")) && ($file != ".")){
//if new row, open
if ( $rowcount == 0 )
echo '
';
//always open |
echo ' | ';
//print the contents of the cell
$dirname = str_replace("/","~",$dirname);
if (is_dir("/home/.diplomat/kyle_osborn/hbband.com/Pictures/$dirname/$file")){
echo "$file ";
} else {
$file = str_replace("~","/",$file);
echo " $file ";
}
//always close the |
echo ' | ';
//if end of row, close
, reset counter
if ( $rowcount >= 5 )
{
echo '
';
$rowcount = 0;
}
//increment $rowcount
$rowcount++;
}
}
//close last if it hasn't already
if ( $rowcount < 6 )
echo '
';
//close ';
closedir($dh);
echo "
";