How can i make a php page that when in a certain directory, would display all the other files in that directory?
Any help would be really appreciated and rep given
Joe

How can i make a php page that when in a certain directory, would display all the other files in that directory?
Any help would be really appreciated and rep given
Joe
This is our situation and we're happy to be here,
I wouldn't change this place for anything.
PHP Code:<?php
$path = "path/to/folder";
$dir = @opendir($path) or die("Can't open $path");
while ($item = readdir($dir)){
echo "<a href='$item'>$item</a><br>";
}
closedir($dir);
?>
“two players, two sides.
one is light, one is dark.”
- John Locke
Ah, i didn't know you could do that with PHP. A prime example that no matter how good at PHP you are, you can always learn more.Thanks ZAG +REP
James
Connected to reality through a proxy server.
Want to hide these adverts? Register an account for free!