Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> How to write a PHP coding to list out all files and directories as links to them?
Nalcolmjean
post
Post #1





Grupa: Zarejestrowani
Postów: 1
Pomógł: 0
Dołączył: 22.01.2013

Ostrzeżenie: (0%)
-----


How to write a PHP coding to list out all files and directories as links to them?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Sephirus
post
Post #2





Grupa: Zarejestrowani
Postów: 1 527
Pomógł: 438
Dołączył: 28.06.2011
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


  1. $directoryPath = '/path/to/directory/with/files/';
  2. $wwwPath = 'http://www.sitename.com/files/';
  3.  
  4. foreach(glob($directoryPath . '*') AS $file) {
  5. echo '<a href="'.$wwwPath.basename($file).'">'.basename($file).'</a><br/>';
  6. }


If i understood U properly (IMG:style_emoticons/default/wink.gif)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 24.12.2025 - 17:52