What I'm doing is having a form page ask, "How many
children do you want to sign up?" Then it spits out form
fields for as many children as they asked for. So each
field has name="C_Last_Name$x" and $x in incremented
for each child. Should I make it name="C_Last_Name[$x]" ?
Jeff Oien

> you should change the form field names to 
> $Children_Last[1], $Children_Last[2]
> instead of hardcoding $Children_Last1
> to make iteration thru the form easier
> and handling of the data easier...
> 
> you can handle it all like this:
> 
> $Number_Children = 5;
> $i = $Number_Children;
>   while ($i--) {
>       if (! $Children_Last[$i]) {
>       // code
>       }
>   }
> 
> > -----Original Message-----
> > From: Jeff Oien [mailto:[EMAIL PROTECTED]]
> > Subject: [PHP] Variable Next To Variable?
> > 
> > 
> > Sorry if this has been brought up 100 times.
> > I want to do this:
> > 
> > $y = "1";
> > 
> > while ($y <= "$Number_Children") {
> >     if (!$C_Last_Name$y) {
> >             error stuff;
> >             $y++;
> >     }
> > }
> > 
> > The form submitting information to this code has field name like
> > C_Last_Name1 C_Last_Name2 depending on how many Children
> > are signing up for something. So I need $y to represent the number.
> > 
> > Hope that makes sense. Thanks for any help.
> > Jeff Oien
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to