$path = "/images/"; //path from root $dir_handle = @opendir($path) or die("Unable to open $path"); while ($file = read­dir($dir_handle)) { if($file == "." || $file == ".." || $file == "index.php" ) con­tinue; echo '
'; //formatting this is up to you } closedir($dir_handle);