List all files in a directory with PHP
This code snippet displays a hyper linked list of all the files contained in a specified folder. I find myself always coming back to this very useful piece of code. I can't count how many times I've used this.
PHP:
-
<?
-
// Define the full path to the folder whose contents you want to list
-
$path = "/home/user/public/foldername/";
-
// Open the directory
-
// Loop through the files
-
if($file == "." || $file == ".." || $file == "index.php" ) { continue; }
-
-
echo "<a href=\"$file\">$file</a><br />";
-
}
-
// Close
-
?>

My name is Noah Everett. I live in Tulsa, OK. I started 
I love the script, and have found sooo many uses. I have had to make one minor change, however, due to a linking problem. You have forgotten to add the variable $path in front of the variable $file... The link won't work unless you make this one minor change.
Other than that, GREAT JOB!