Display Contents of a Folder





14
Date Submitted Thu. Mar. 1st, 2007 3:48 PM
Revision 1 of 1
Helper mjlintz
Tags PHP
Comments 5 comments
Display contents of a folder, see comments in code.

<?
if ($handle = opendir('./images')) //change to point to your directory
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
echo "<a href=http://yourdomain.com/images/$file>$file</a><br />"; //change to match your path
}
}
}
?>
 

Michael Lintz

Comments

Comments A better way..
Sun. May. 20th, 2007 10:28 PM    Scripter SecondV
Comments Help
Thu. Mar. 29th, 2007 7:00 AM    Newbie seal
  Comments RE: Help
Tue. Apr. 3rd, 2007 1:59 PM    Newbie dig412
Comments PHP 5 better way
Sat. Jun. 16th, 2007 1:15 PM    Newbie piotrlewandowski
Comments wrong inserted
Sat. Jun. 16th, 2007 1:17 PM    Newbie piotrlewandowski

Voting