Count # of files
#1
Posted 26 November 2005 - 10:12 PM
Any help would be greatly appreciated, and the simpler the script needed the better.
#2
Posted 26 November 2005 - 10:48 PM
FTP functions prove really useful here. The example on the site shows how to get the contents of the directory the file is in, to let the file be able to have a directory specified you must use something like this:
<?php $dir_name = "your directory path on the server"; $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); $contents = ftp_nlist($conn_id, $dir_name); var_dump($contents); ?>
ARGUMENT FROM CREATION, a.k.a. ARGUMENT FROM PERSONAL INCREDULITY (I)
(1) If evolution is false, then creationism is true, and therefore God exists.
(2) Evolution can't be true, since I lack the mental capacity to understand it; moreover, to accept its truth would cause me to be uncomfortable.
(3) Therefore, God exists.
#3
Posted 27 November 2005 - 12:02 AM
#4
Posted 27 November 2005 - 12:08 AM
Too cute! | Server Status: If you can read this, it's up |Well, when it comes to writing an expository essay about counter-insurgent tactics, I'm of the old school. First you tell them how you're going to kill them. Then you kill them. Then you tell them how you just killed them.
#5
Posted 27 November 2005 - 01:54 AM
I got it working amazingly well like so:
<?php if (is_dir($dir)) { $dh = opendir($dir); if($dh = opendir($dir)){ while (($file = readdir($dh)) !== false ) { $dot = explode('.',$file); if(is_dir($file) | count($dot)!=2 ){ $type = 'Directory';} else{ $type = 'File'; echo '<div id="file">' . $file . '<br><div id="download"><a href="?file=' . $file . '">Download</a></div></div><br>'; } } } closedir($dh); } else { echo 'Directory does not exist'; } ?> </div>Which then links it to the code that I got help with before. I am exceptionally pleased.
#6
Posted 28 November 2005 - 04:18 AM
Edited by DeathRay2K, 28 November 2005 - 04:20 AM.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users