Mega Code Archive

 
Categories / Php / Code Snippets
 

This is the next step in the directory file viewer , allowing your users to

click on the files to view them <table> <tr><th>file viewer</th></tr> <?php $directory = opendir('./images'); while ($files = readdir($directory)) { $file_array[] = $files; } foreach ($file_array as $files) { echo "<tr><td>"; if($files == ".." || $files == ".") { continue; } echo "<a href=\"$files\" target = \"_blank\">$files</a><br>"; echo "</tr>"; } ?> </table>