$link = $_GET['link']; echo "\n"; chdir('D:/Host/Sites/images/Party/' . $link . '/Pix/'); $handle=opendir('.'); $count; while (($file = readdir($handle))!==false) { $isdir = is_dir ($file); //is it a dir if (!$isdir) //if not $isdir { if(stristr($file, 'Video') == TRUE) { echo "
" . //link "
\n" . //img tag round(((filesize($file) / 1024) /1024), 2) . " MB
\n"; //
MB to 2 decimal places $count++; //adds 1 to $count } else { echo "
" . //link "
\n" . //img tag round(((filesize($file) / 1024) /1024), 2) . " MB
\n"; //
MB to 2 decimal places $count++; //adds 1 to $count } } if ($count == 5) //if $count is 5 { echo "\n"; //end row, new line in code $count=0; //set $count to 0 } } closedir($handle); ?>