Directory lister - Php

Listout files in Dir

Snippet Code


  
Rate this page :
  [ 0 votes]

Displays a hyperlinked list of all the files contained in a specified folder. A really simple way to have your own directory browser, just drop the file in the folder and it will show an index of all files in the directory on your webspace.

<?php $path = "Your Path"; $dir_handle = @opendir($path) or die("Unable to open $path"); while ($file = readdir($dir_handle)) { if($file == "." || $file == "..") continue; echo "<a href="$file">$file</a> "; } closedir($dir_handle); ?>

Tags


Ask Questions

Ask Question