View previous topic :: View next topic |
Author |
Message |
Arctic -
Joined: 24 Sep 2004 Posts: 560
|
Posted: Wed Apr 20, 2005 2:13 pm Post subject: Directory Listing |
|
|
Is there a PHP script that genetates a list of the files in the directory? It would be nice if you could help :O |
|
Back to top |
 |
 |
MonkeyNation -
Joined: 05 Feb 2005 Posts: 921 Location: Cardiff
|
|
Back to top |
 |
 |
Arctic -
Joined: 24 Sep 2004 Posts: 560
|
Posted: Wed Apr 20, 2005 4:40 pm Post subject: |
|
|
Does it work if I just stick it in a directory? Can I take away the images? I need a very simple script, no images, just lists all the files in the directory using names and links. |
|
Back to top |
 |
 |
AbyssUnderground -
Joined: 31 Dec 2004 Posts: 3855
|
Posted: Wed Apr 20, 2005 5:53 pm Post subject: |
|
|
Im sure you could just edit the code a bit to get rid of the images. If you go to the scripts page on www.abyssunderground.co.uk there is a script there for directory listings which i wrote. _________________ Andy (AbyssUnderground) (previously The Inquisitor)
www.abyssunderground.co.uk |
|
Back to top |
|
 |
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Wed Apr 20, 2005 8:43 pm Post subject: |
|
|
Yes , you can remove the images if you don't want images but I think the script
only works when using the Directory Listing feature in Abyss Web Server , im not
sure but I think I tried it once and you had to use with the Directory Listing.
Here's a PHP script that can do what your asking for.
Code: |
<pre>
<?php
$dir = ".";
$open = opendir($dir);
while ($file = readdir($open)) {
if (is_file($file)) {
echo "<a href=\"$file\">$file</a>\n";
}
}
closedir($open);
?>
</pre> |
|
|
Back to top |
|
 |
|