Re: form question

From: Date: Tue, 18 Jul 2000 20:17:27 +0000
Subject: Re: form question
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-7145@lists.php.net to get a copy of this message
"Martin A. Marques" wrote: > > On Tue, 18 Jul 2000, Lars Wilhelmsen wrote: > > Hi. > > > > Let's take an example form: > > > > <form action="foo.php4" method="post"> > > <input type="text" name="bar"> > > <input type="submit" name="go" value="Go!"> > > </form> > > > > Ok... when this form is submitted, you can access all the fieldinformation > > in php by taking the name you've placed in name="" and place a $ in front > > of it. > > Actually I happen to know that. Maybe I didn't explain my problem correctly. > The form is generated dynamically, so I don't know the name of the variables > on the INPUTs which are checkboxes. This form calls another php script which > gets the variables of these input checkboxes. > How do I know the name of those variables? > > Thanks!! > Martin, I've run into this problem many times myself. I'm sure there are methods or hacks to achieve what you are asking, but I usually try to figure out a better way to create my form so that it is easier to parse, like making the form variable names consistant and making the values dynamic, or putting hidden values along side of form elements to track corresponding data. What does your form elements consist of exactly?

« previous php.general (#7145) next »