Toon posts:

[php]Lijst van inhoud directory maken

Pagina: 1
Acties:
  • 86 views sinds 30-01-2008

Verwijderd

Topicstarter
Ik wil in PHP (en als dat echt niet kan desnoods in ASP) een lijst maken van alle bestanden in een directory.

Zeg maar zo'n directory listing die je soms te zien krijgt (als je rechten daarvoor hebt) als er geen index-pagina is.

Kan dit in PHP (of ASP)?

Verwijderd

ja dat kan.

plz goto http://www.php.net/manual/

en leef je uit :)

Verwijderd

Topicstarter
:o *schaam*

Ik heb die complete manual op mijn PC staan, maar ik kon het niet vinden.

Nou ja, ik zal nog even kijken dan

Merci

Verwijderd

*hint*

check de replies in de online versie.

bij de directory functies enzo ;)

Verwijderd

zoiets van...
PHP:
1
2
3
4
5
6
7
8
9
10
<?
echo  '<ul>';
$dir = dir(".");
while ($entry = $dir->read())
{
echo '<li><a href="$entry">$entry</a>';
}
$dir->close();
echo '</ul>';
?>

  • KolNedra
  • Registratie: September 2001
  • Laatst online: 18-04-2020

KolNedra

...

Op zaterdag 16 juni 2001 13:16 schreef Anchorman het volgende:
zoiets van...
PHP:
1
<?echo  '<ul>';$dir = dir(".");while ($entry = $dir->read()){echo '<li><a href="$entry">$entry</a>';}$dir->close();echo '</ul>';?>
Tnx Anchorman, alleen bedenk wel dat als je een echo ''; uitvoert dat hij dan ook exact echoed wat je typt, draai het om naar:
echo "<li><a href='$entry'>$entry</a>";

Alsnog bedankt, was opzoek naar zoiets :D

::: flickr.com/kolnedra ::: Nikon D80 + Sigma 18-200mm f/3.5-6.3 DC + Sigma 10-20mm f/4-5.6 EX DC HSM


  • tomato
  • Registratie: November 1999
  • Niet online
Tsja, je kunt ook gewoon directory indexing aanzetten in je webserver config :)

Verwijderd

van vandaag:

[topic=456463/1/25]

  • drm
  • Registratie: Februari 2001
  • Laatst online: 09-06-2025

drm

f0pc0dert

van een jaar geleden:
[topic=163091]

|:(

Music is the pleasure the human mind experiences from counting without being aware that it is counting
~ Gottfried Leibniz


  • tomato
  • Registratie: November 1999
  • Niet online
drm: van een jaar geleden:
[topic=163091]

|:(
:D

  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 09-09 20:58

Janoz

Moderator Devschuur®

!litemod

nou.. ik gooi 'm nu maar dicht, ik moet natuurlijk wel een beetje consequent blijven he :)

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'

Pagina: 1

Dit topic is gesloten.