Re: another try...

From: Date: Tue, 09 Apr 2002 00:20:58 +0000
Subject: Re: another try...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-92149@lists.php.net to get a copy of this message
Ok I have it working to a point... how can I impliment a loop to count the files in the directory, right now it only pulls the first file into the select box. Here is the code: <?php $dir_name = "/path/to/images/directory/on/server/"; $dir = opendir($dir_name); while ($file_name = readdir($dir)) { if (($file_name != ".") && ($file_name !="..")) { $file_list = "<p><FORM METHOD=\"post\" ACTION=\"index_done.php3\" NAME=\"$file_name\"><SELECT NAME=\"files\"> <OPTION VALUE=\"$file_name\" NAME=\"$file_name\">$file_name</OPTION> </SELECT><br><br><INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"select\"></FORM></p>"; } } closedir($dir); ?> Thanks, in advance Jas

« previous php.general (#92149) next »