How to list a directory as UrL's??

 
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions
View previous topic :: View next topic  
Author Message
Youltar
-


Joined: 28 Oct 2003
Posts: 1

PostPosted: Wed Dec 29, 2004 6:03 am    Post subject: How to list a directory as UrL's?? Reply with quote

I have a question about directory listing. I'm intrested in making a web page for someof my programs and such. I would like to have a way to generate a link list of all the files stored in a specific directory. better yet, I would like to be able to just change the content of the directory without changing any of the code in the html. Can this be done?

here is a rough idea of what im looking for, essesntially I would like the list to be hyperlinks so the files can be downloaded.
http://68.115.6.196:2125/sample.gif
Back to top View user's profile Send private message
Arctic
-


Joined: 24 Sep 2004
Posts: 560

PostPosted: Wed Dec 29, 2004 6:10 am    Post subject: Reply with quote

A message

Last edited by Arctic on Sat Apr 20, 2019 5:32 pm; edited 1 time in total
Back to top View user's profile Send private message ICQ Number
rambo
-


Joined: 20 Dec 2004
Posts: 11

PostPosted: Wed Dec 29, 2004 5:14 pm    Post subject: Reply with quote

what font do you got going there, its pretty cool.
Back to top View user's profile Send private message
Arctic
-


Joined: 24 Sep 2004
Posts: 560

PostPosted: Wed Dec 29, 2004 6:19 pm    Post subject: Reply with quote

A message

Last edited by Arctic on Sat Apr 20, 2019 5:32 pm; edited 1 time in total
Back to top View user's profile Send private message ICQ Number
Glitch2082
-


Joined: 02 Dec 2004
Posts: 194

PostPosted: Wed Dec 29, 2004 11:37 pm    Post subject: Reply with quote

Thanks glyde :D.
In PHP thick manual you can find something like this...

Code:

<?php
$dir = "DN/";
if (is_dir($dir)) {
   if ($dh = opendir($dir)) {
       while (($file = readdir($dh)) !== false) {
           echo "$file." . filetype($dir . $file) . "<br>";
       }
       closedir($dh);
   }
}
?>


You can play with the html from the
echo "$file." . filetype($dir . $file) . "<br>";

but it will just list files as you put them in there.

Note: That all goes into index.php and placed in the directory. The $dir needs to be changed from /DN to /DirectoryOfChoice
_________________
int main() {
cout << "Im Pro Apache";
cin.get();
}
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> General Questions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group