Re: Directory to array to select box...

From: Date: Fri, 05 Apr 2002 16:36:05 +0000
Subject: Re: Directory to array to select box...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-91739@lists.php.net to get a copy of this message
Sorry, here is what I have thus far... everything is working except I am just not sure how to pass the result of the users selection to another script, I have added the hidden input type to try and solve it but I think I am doing something wrong, maybe I need to put the hidden input type on the second script to place the contents into the database, here is the code... <?php $dir_name = "/path/to/directory/"; $dir = opendir($dir_name); $file_list .= "<p><FORM METHOD=\"post\" ACTION=\"ad_done.php3\"> <SELECT NAME=\"files\">$file_name"; while ($file_name = readdir($dir)) { if (($file_name != ".") && ($file_name !="..")) { $file_list .= "<OPTION VALUE=\"$file_name\">$file_name</OPTION>"; } } // added hidden field here... and so far it is not getting any value, so i am assuming that i need it on my ad_done.php3 script??? $file_list .= "<INPUT TYPE=\"hidden\" NAME=\"$file_name\" VALUE=\"$file_name\"></SELECT><br><br><INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"select\"></FORM></p>"; closedir($dir); ?>

« previous php.general (#91739) next »