<?php if (file_exists ("./")) { if (is_dir ("./")) { $dh = opendir ("./") or die (" Directory Open failed !"); while ($file = readdir ($dh)) { echo "$filen"; } echo "Directory was opened successfully"; Closedir ($dh); } } ?>