Re: Listing files

From: Date: Mon, 31 Dec 2001 19:25:41 +0000
Subject: Re: Listing files
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-79145@lists.php.net to get a copy of this message
I am very honour of your suggestion but I am not the author of the function GetDirArray($sPath). The author is ansinn@comcat.com (I don't know him). It isn't ethic to publish this function under my name. Best regards, George Nicolae IT Manager ___________________ X-Playin - Professional Web Design www.x-playin.f2s.com ----- Original Message ----- From: "Boaz Yahav" <berber@netvision.net.il> To: "George Nicolae" <geomasterweb@hotmail.com> Sent: Monday, December 31, 2001 9:05 PM Subject: RE: [PHP] Re: Listing files This looks like a great example to add to weberdev. Care to spend 3 minutes and let other PHP developers enjoy from your experience? You are one click away from doing a good deed :) http://www.weberdev.com/index.php3?GoTo=addexample.php3 Sincerely berber Visit http://www.weberdev.com Today!!! To see where PHP might take you tomorrow. -----Original Message----- From: George Nicolae [mailto:geomasterweb@hotmail.com] Sent: Monday, December 31, 2001 7:00 PM To: php-general@lists.php.net Subject: [PHP] Re: Listing files $path="c:/";//your path function GetDirArray($sPath) { //Load Directory Into Array $handle=opendir($sPath); while ($file = readdir($handle)) if(($file!=".")&($file!="..")) $retVal[(isset($retVal))?count($retVal):0] = $file; //Clean up and sort closedir($handle); sort($retVal); return $retVal; } $a=GetDirArray($path); //echo "test".count($a); //for ($i=0;$i<count($a);$i++) echo $a[$i]."<br>"; ?> <select name="select"> <? for ($i=0;$i<count($a);$i++) { ?> <option value="test" onchange='location="//go to the specific location and/or file"'><?echo $a[$i];?></option> <? } ?> </select> -- "Todd Cary" <todd@aristesoftware.com> wrote in message news:3C3091D1.40FE5F87@aristesoftware.com... > I would like to present the surfer with a list of files in a directory > (I'll probably put then into a drop-down) and then I want to send the > file to the surfer if one is selected. I am not sure of the syntax to > > 1) List the files in a directory > > 2) Send a selected file to the surfer > > Many thanks for any help in getting the correct syntax to do this...... > > Todd > > -- > Todd Cary > Ariste Software > todd@aristesoftware.com > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#79145) next »