Bj, one problem with this is if you want to do some javascript processing on the client side. I don't know a way to directly access such an element in javascript. Whenever I use a form array element, I use document.form.elements[0...n] array to manipulate it which is ugly.
R'twick ----- Original Message ----- From: "Bj" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 11, 2003 3:28 PM Subject: [wdvltalk] Re: Accessing form variables as an array? > ----- Original Message ----- > From: "Michael Milligan" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: 11 June 2003 18:48 > Subject: [wdvltalk] Accessing form variables as an array? > > > > Does someone know how to snag form variables in PHP when the number of > > variables submitted from the various sending forms? > > > > I see $PHP_POST_VARS['form variable name'] available, but only indexed > > associatively. Is there some way that this can be done without knowing the > > number of variables or the variables names in the form? > > Give all your form variables the same name with square brackets after (input > type="text" name="formvar[]") and they will go into an array. To read them, > $vars = $HTTP_POST_VARS["formvar"] then you can use count($vars) to see how > many variables and each($vars) to get the values... > > Bj > > > > ____ . The WDVL Discussion List from WDVL.COM . ____ > To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] > Send Your Posts To: [EMAIL PROTECTED] > To change subscription settings to the wdvltalk digest version: > http://wdvl.internet.com/WDVL/Forum/#sub > > ________________ http://www.wdvl.com _______________________ > > You are currently subscribed to wdvltalk as: [EMAIL PROTECTED] > To unsubscribe send a blank email to %%email.unsub%% > ____ � The WDVL Discussion List from WDVL.COM � ____ To Join wdvltalk, Send An Email To: mailto:[EMAIL PROTECTED] Send Your Posts To: [EMAIL PROTECTED] To change subscription settings to the wdvltalk digest version: http://wdvl.internet.com/WDVL/Forum/#sub ________________ http://www.wdvl.com _______________________ You are currently subscribed to wdvltalk as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
