Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
PHP Help, Listing files in a Directory
Old 10-05-2002, 09:43 AM PHP Help, Listing files in a Directory
Blizack's Avatar
Experienced Talker

Posts: 40
Trades: 0
I'm working on a gallery and am trying to list all the files in a directory. My book says that to list all the directories I need to use ftp_nlist (ftp_stram, directory). Just one problem though... I have no idea what ftp_stream is. So if anyone could help that'd be great.
__________________
Webmaster of Desktopgamers.com and vgProjects.com
Blizack is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 10-05-2002, 11:28 PM
conkermaniac's Avatar
The Nutty Moderator

Posts: 1,012
Location: China
Trades: 0
Hmm...I just did a search for ftp_stream on Google, and the top sites were all in different languages.

There were sites in German, French, Chinese, Russian, and English in just 10 results, but none of them seemed helpful at all.
__________________

Please login or register to view this content. Registration is FREE
- Affordable feature-packed remotely hosted message boards!
conkermaniac is offline
Reply With Quote
View Public Profile
 
Old 10-06-2002, 01:11 AM
Blizack's Avatar
Experienced Talker

Posts: 40
Trades: 0
Yea I had the same tihng
__________________
Webmaster of Desktopgamers.com and vgProjects.com
Blizack is offline
Reply With Quote
View Public Profile
 
Old 10-06-2002, 05:18 AM
AhmedF's Avatar
Left for Better Places

Posts: 258
Trades: 0
Code:
<?php
$dir_name="e:\\publicnew\\sales alerts";
$url_name="https://www.colonyliquor.com/salesalerts";

$dir = opendir($dir_name);
$basename = basename($dir_name);
$fileArr = array();

while ($file_name = readdir($dir))
{
if (($file_name !=".") && ($file_name !=
".."))
{
#Get file modification date...
#
$fName = "$dir_name/$file_name";
$fTime = filemtime($fName);
$fileArr[$file_name] = $fTime;
}
}

# Use arsort to get most recent first
# and asort to get oldest first
arsort($fileArr);

$numberOfFiles = sizeOf($fileArr);
for($t=0;$t<$numberOfFiles;$t++)
{
$thisFile = each($fileArr);
$thisName = $thisFile[0];
$thisDay = $thisFile[1];
$thisTime = $thisFile[1];
$thisDay = date("m/d/Y", $thisDay);
$thisTime = date("h:i:s a", $thisTime);
echo "<font face='Geneva, Arial, Helvetica, san-serif' size='4' color='#000000'>";
echo "$thisDay    $thisTime    <a href='$url_name/$thisName'>$thisName</a></font><br>";
}
closedir ($dir);
?>
Mind you ... not my code ... so do not credit me
AhmedF is offline
Reply With Quote
View Public Profile
 
Old 10-06-2002, 12:27 PM
Blizack's Avatar
Experienced Talker

Posts: 40
Trades: 0
Woah cool, thank you very much!
__________________
Webmaster of Desktopgamers.com and vgProjects.com
Blizack is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to PHP Help, Listing files in a Directory
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.25810 seconds with 12 queries