Go Back   Web Hosting UK Forums | Linux Windows Dedicated Server and cPanel VPS Hosting Forum > Support > php issues.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-25-2007, 04:25 PM
Senior Member
 
Join Date: Jul 2007
Posts: 132
Default Anyone have a script to show all files in a folder

I need to have a script to show all files in a folder (so customer can view them without FTP) they will change daily.

Anyone go a dirty script to start me off ? I am happy to supply the modified version back to them with added features to display orders on SSL
Reply With Quote
  #2 (permalink)  
Old 09-09-2007, 05:50 AM
SBh SBh is offline
Member
 
Join Date: Sep 2007
Posts: 58
Default

Code:
$folder = "forum/"; //change directory name as you wish
$handle = opendir($folder); 

while ($file = readdir($handle)) 
{
 $files[] = $file; 
} 
closedir($handle); 

foreach ($files as $file) { 
    echo $file."<br>"; 
}
With this code you can list all files in a directory. With additional modifications you can let it work in recursive way.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 04:12 AM.
Copyright 2002-2007 WebHosting.uk.com. All rights reserved.
Web Hosting UK Forum