Creating HTML page of folder contents?
Creating HTML page of folder contents?
I know there is a similar way when one creates a gallery, but is there a way to automatically generate and display contents of a web folder into an HTML page? Or would a directory listing be better and how would I do that? What I am trying to do is upload some various files to our clients to be accessed by login and since there will be so much volume of files, I want to see if I can upload them and organize them in the fastest and best way possible. Thanks for your suggestions!
Theres only one problem with doing the default directory listing which is if your host has directory lists disabled (as mine does) for safety reasons there really isn't much you can do about that method.
Tobycat is picky about that kind of stuff so I don't really pester him about it. Most, though, allow it with no problems.
Perhaps if you're nice enough to Testi he might whip something up for you pretty quickly if it doesn't require a bunch of time.
Tobycat is picky about that kind of stuff so I don't really pester him about it. Most, though, allow it with no problems.
Perhaps if you're nice enough to Testi he might whip something up for you pretty quickly if it doesn't require a bunch of time.
Here's a PHP page that gets a list of all files in the same directory (except for the PHP page itself):
Code: Select all
<html>
<title>Directory listing</title>
</head>
<body>
<pre>
<?php
$thispage = basename($_SERVER['PHP_SELF'];
foreach(glob('*') as $name)
{
if($name !== $thispage)
{
echo "<a href=\"$name\">$name</a>
}
";
}
?>
</pre>
</body>
</html>
-
- Defender of the Night
- Posts: 13477
- Joined: Thu Nov 05, 1998 12:01 pm
- Location: Olathe, KS
- Contact:
http://gallery.menalto.com/modules.php? ... file=index
Thats what I'll be using soon to show off my 3D artwork.
Thats what I'll be using soon to show off my 3D artwork.
Unfortunately the only thing the server supports is ASP. No php, no CGI, none of that, so it made my job difficult, especially considering I had no choice but to code the rest of the website using FrontPage (eeewww!)
However I did manage to find a VERY nice program which supports ASP and looks very nice and allows you to restrict what file types are to be seen and can hide directories you dont want to show. Its DirList2.1.1 and I highly reccomend it that you check it out. {url=http://fx-scripts.com/dirlist.asp]Linky.[/url]
However I did manage to find a VERY nice program which supports ASP and looks very nice and allows you to restrict what file types are to be seen and can hide directories you dont want to show. Its DirList2.1.1 and I highly reccomend it that you check it out. {url=http://fx-scripts.com/dirlist.asp]Linky.[/url]