Re: Re: another try...
| From: | Oliver Heinisch | Date: | Tue, 09 Apr 2002 07:03:04 +0000 |
| Subject: | Re: Re: another try... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-92187@lists.php.net to get a copy of this message | ||
Aeh,
maybe you should make a plan, first, what to do. ;-)
That´s normal if you go to the supermarket, why not on softwaredevelopment?
At 08.04.2002 18:20, you wrote:
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); echo "<p><FORM METHOD=\"post\" ACTION=\"index_done.php3\" NAME=\"Foo\">";echo "<SELECT NAME=\"files\">"; // form name not really required, and shouldn´t be a var.
while ($file_name = readdir($dir))
{
if (($file_name != ".") && ($file_name !=".."))
{
echo "<OPTION VALUE=\"$file_name\" NAME=\"my_file[]\">$file_name</OPTION>";
// how can you get the option name in your next script if you use $filename??
look for arrays, getting content from arrays. HTH Oliver} // end if} // end while echo "</SELECT><br><br>"; echo "<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"select\"></FORM></p>"; closedir($dir); ?> Thanks, in advance Jas I know your next Question :) , How to get the selected values in my script "index_doen.php3"