Here is what I need some information about, the script below opens a
directory on the server, reads the files and places them into select boxes
within a form, now I have this echoed multiple times on the page like
so...<? echo "$file_list"; ?> Now I have tried to assign a form name based
on the $file_name varibable but because the $file_name variable is created
after the form has been created I cannot assign a unique form name each time
I call <? echo "$file_list"; ?>. If someone could point out another way to
do this or point out a good function for this I would greatly appreciate it.
<?php
$dir_name = "/path/to/images/directory/";
$dir = opendir($dir_name);
$file_list .= "<p><FORM METHOD=\"post\" ACTION=\"index_done.php3\">
<SELECT NAME=\"files\">";
while ($file_name = readdir($dir)) {
if (($file_name != ".") && ($file_name !="..")) {
$file_list .= "<OPTION VALUE=\"$file_name\"
NAME=\"$file_name\">$file_name</OPTION>";
}
}
$file_list .= "</SELECT><br><br><INPUT TYPE=\"submit\" NAME=\"submit\"
VALUE=\"select\"></FORM></p>";
closedir($dir);
?>
Thanks in advance,
Jas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php