Re: Array form processing

From: Date: Tue, 29 Jun 2010 21:06:57 +0000
Subject: Re: Array form processing
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-306552@lists.php.net to get a copy of this message
The painDesc array is what that should be iterated. --Shreyas On Wed, Jun 30, 2010 at 2:27 AM, Ashley Sheridan <ash@ashleysheridan.co.uk>wrote: > On Tue, 2010-06-29 at 16:54 -0400, Ron Piggott wrote: > > > I am trying to process a form where the user uses checkboxes: > > > > <input type="checkbox" name="painDesc[]" value="1" > > />Sharp > > <input type="checkbox" name="painDesc[]" value="2" > > />Stabbing > > <input type="checkbox" name="painDesc[]" value="3" > > />Jabbing > > > > When I do: > > > > foreach($_REQUEST as $key => $val) { > > $$key = $val; > > echo $key . ": " . $val . "<br>"; > > } > > > > The output is: > > > > painDesc: Array > > > > I need to know the values of the array (IE to know what the user is > > checking), not that there is an array. I hope to save these values to > the > > database. > > > > Thank you. > > > > Ron > > > > > > > You need to iterate that array, as that holds the values of everything > sent by the browser > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- Regards, Shreyas Agasthya

« previous php.general (#306552) next »