Re: Variable Nightmare

From: Date: Thu, 09 Oct 2003 05:38:36 +0000
Subject: Re: Variable Nightmare
References: 1  Groups: php.general php.general 
Request: Send a blank email to php-general+get-165579@lists.php.net to get a copy of this message
The server probably has global variables turn off Try $_GET['value1'], $_GET['value2'] If you using post method then replace $_GET with $_POST On Thursday 09 October 2003 00:51, richard cook wrote: > Hi all, > I have a problem that I cant solve, any help would be welcomed! > > > I have a form which is repeated by a for loop, the form has one element an > input field. The problem im having is the name of this field for example > ive used the following to name it: > > for loop here > > <input name="value<?php echo $x;?>" type="text" size="4" > maxlength="2" > value="<?=$cart_Array[$x][1]?>" /> > > } > > So the input name will increase with each loop like so: > > value1 > value2 > value3 > ... > > This works fine, the source code from the generated page looks as it > should. So the big question is how do I get to the variable name when the > form is processed, ive tried everything i know. if I use hard coding it > works : > > $myNewVar = $value1; > > But the whole point of this is that the values need to be pulled out of > another for loop: > > for loop blah > $myNewVar = $valueX; > } > > > > > I hope im explaining this well..... > > > > Regards > > R -- Ryan Thompson rthomp@sympatico.ca http://osgw.sourceforge.net ============================== "A computer scientist is someone who fixes things that aren't broken" --Unknown

« previous php.general (#165579) next »