Looks like I should have been keeping a close eye on that thread... I am pulling
fields from a database and displaying them on my page. I am adding a checkbox next to
the name and storing the name in the checkbox value. Anyway, on submission I want to
process them but am having problems...
p
ldren( $C_Last );
if you used individual variables, you could
not do that in any easy or efficient way.
> -Original Message-
> From: Jeff Oien [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 11, 2001 1:29 PM
> To: PHP
> Subject: FW: [PHP] Variable Next To Variable?
>
>
how about :
if ((isset($number ))&&($number <= $max)){
while ($number > 0;$number -- ) {
echo 'Last Name';}
}
if you're not crazy about having the fields labled in reverse order you
could push to an array and then arsort the array.
Ma
fills out 8 for the max, and then only ends up filling in
C_Last_Name1, C_Last_Name4, C_Last_Name7 you wont have to worry about it.
-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 11, 2001 10:29 AM
To: PHP
Subject: FW: [PHP] Variable Next To Variable
; $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 Variabl
I think you want
if (!(${"C_Last_Name$y"})) {
or
if (!(${"C_Last_Name".$y})) {
-Original Message-
From: Jeff Oien [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 11, 2001 10:22 AM
To: PHP
Subject: RE: [PHP] Variable Next To Variable?
I like this idea but it
I like this idea but it's giving me a parse error on this code:
if (!{$C_Last_Name}{$y})
I'm looking at the other ideas also.
Jeff Oien
> > if (!$C_Last_Name$y) {
> > The form submitting information to this code has field name like
> > C_Last_Name1 C_Last_Name2 depending on how many Child
You could use an array:
like
Way better this way
and you oculd do:
$y=1;
while($y
> 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;
> $
--) {
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:
>
&g
> if (!$C_Last_Name$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.
You want this:
if (!{$C_Last_Name}{$y}) {
The {} surrounding the var
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
11 matches
Mail list logo