in reply to variables get overwritten (loop problem? i dunno)
Okay, after staring at this for about half an hour I think I've got it. The error is in the HTML code you generate. Basically, you generate a table for each file found in a directory. This table contains some textfields, all of which are in the same form. Now all of the textfields for each of the files all have the same name, hence the data which is passed when the user hits the submit is just one of the fields with the same names, and that happens to be the first one.
To solve this, generate a form per file, each containing the table you already create and each containing a submit button. That way only one textfield will be passed upon submit and you'll get the user's choice rather than the first in the form.
Hope this helps, -gjb-
Update: Depanding on what you want to do in the CGI script that receives this form's info, it may be quite dangerous to have the file names in the HTML form since it's quite easy to fake a response with other file names (/etc/passwd comes to mind ;-) Since the checkbox already indicates which file has been selected, it might be better to compute the file name and info from that information in the receiving CGI scipt.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: variables get overwritten (loop problem? i dunno)
by Anonymous Monk on Jan 04, 2003 at 05:35 UTC | |
by gjb (Vicar) on Jan 04, 2003 at 09:00 UTC |