| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| Youltar -
 
 
 Joined: 28 Oct 2003
 Posts: 1
 
 
 | 
			
				|  Posted: Wed Dec 29, 2004 6:03 am    Post subject: How to list a directory as UrL's?? |   |  
				| 
 |  
				| 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 |     | 
	
		|  | 
	
		| Arctic -
 
 
 Joined: 24 Sep 2004
 Posts: 560
 
 
 | 
			
				|  Posted: Wed Dec 29, 2004 6:10 am    Post subject: |   |  
				| 
 |  
				| A message 
 Last edited by Arctic on Sat Apr 20, 2019 5:32 pm; edited 1 time in total
 |  | 
	
		| Back to top |      | 
	
		|  | 
	
		| rambo -
 
 
 Joined: 20 Dec 2004
 Posts: 11
 
 
 | 
			
				|  Posted: Wed Dec 29, 2004 5:14 pm    Post subject: |   |  
				| 
 |  
				| what font do you got going there, its pretty cool. |  | 
	
		| Back to top |     | 
	
		|  | 
	
		| Arctic -
 
 
 Joined: 24 Sep 2004
 Posts: 560
 
 
 | 
			
				|  Posted: Wed Dec 29, 2004 6:19 pm    Post subject: |   |  
				| 
 |  
				| A message 
 Last edited by Arctic on Sat Apr 20, 2019 5:32 pm; edited 1 time in total
 |  | 
	
		| Back to top |      | 
	
		|  | 
	
		| Glitch2082 -
 
 
 Joined: 02 Dec 2004
 Posts: 194
 
 
 | 
			
				|  Posted: Wed Dec 29, 2004 11:37 pm    Post subject: |   |  
				| 
 |  
				| 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 |       | 
	
		|  | 
	
		|  |