Re: Assigning unique form names...

From: Date: Mon, 08 Apr 2002 20:06:48 +0000
Subject: Re: Assigning unique form names...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-92126@lists.php.net to get a copy of this message
Where are you getting the target of ACTION= from? Is it just any one of the <OPTION>s? I don't understand what you're trying to do (and I don't think I'm alone here - you may even be among us). Can you give a concrete example of what is in the database and how you would like the HTML to look? miguel On Mon, 8 Apr 2002, Jas wrote: > Yeah I have tried $file_name but the problem stems from the while > ($file_name = readdir($dir) being called after the creation of the form in > $file_list. Is there a way to put the ($file_name = readdir($dir) before > the $file_list function? I have tried to do it a couple of different ways > such as making a new variable $files = ($file_name = readdir($dir)) { > if (($file_name != ".") && ($file_name !="..")) { > $file_list .= "<OPTION VALUE=\"$file_name\" > NAME=\"$file_name\">$file_name</OPTION>"; > } > } > but that didn't work, I also tried another thing but so far nothing has > allowed me to create a unique action in the form or a unique name for the > form. > <?php > $dir_name = "/path/to/images/directory/"; > $dir = opendir($dir_name); > $file_list .= "<p><FORM METHOD=\"post\" ACTION=\"**I need this to > be a > unique file name**\" NAME=\"$file_name\"><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); > ?> > > > >

« previous php.general (#92126) next »