RE: [PHP] Reading Form Fields...

From: Date: Wed, 21 May 2003 18:39:02 +0000
Subject: RE: [PHP] Reading Form Fields...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-148432@lists.php.net to get a copy of this message
there's also foreach... foreach ($_POST as $name => $value) { echo "$name => $value<br>"; } -Dan Joseph > -----Original Message----- > From: Matt Grimm [mailto:mgrimm@healthtvchannel.org] > Sent: Wednesday, May 21, 2003 2:37 PM > To: php-general@lists.php.net > Subject: Re: [PHP] Reading Form Fields... > > > > How can I process a batch of form fields? > > Instead of naming every single variable is it possible to get every > > variable out with a 'while'? > > I believe you're looking for the $_POST vars (if your form is posting with > method 'post'): > > if ($_POST) { > extract $_POST; > } > > // OR > > if ($_GET) { > extract $_GET; > } > > And you are required to name each of the fields with a unique > name (since it > will become the variable name). > > -- > Matt Grimm > Web Developer > The Health TV Channel, Inc. > (a non - profit organization) > 3820 Lake Otis Parkway > Anchorage, AK 99508 > 907.770.6200 ext. 686 > 907.336.6205 (fax) > E-mail: mgrimm@healthtvchannel.org > Web: www.healthtvchannel.org > > ----- Original Message ----- > From: "Andreas Cahen" <qube@space.ch> > To: <php-general@lists.php.net> > Sent: Wednesday, May 21, 2003 10:23 AM > Subject: [PHP] Reading Form Fields... > > > > I guess this question has been posted before, but I am new to the list.. > > > > > > How can I process a batch of form fields? > > Instead of naming every single variable is it possible to get every > > variable out with a 'while'? > > > > The goal is to design a very flexible form. > > > > Any suggestions? [I know how to do it the old fashioned way :) ] > > > > > > Cheers, > > > > Andreas Cahen > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.general (#148432) next »