A good suggestion, Bj, but I won't be the guy making up the forms or determining the fields. My code just needs to pick out one variable that will be common to all forms and make a decision where to send it the form results. R'twicks solution is better suited given that situation, but I thank you very much for your help.
All the best, Mike Michael M Milligan Web Developer (818) 909-9209 www.mmmilligan.com <http://www.mmmilligan.com> -----Original Message----- From: Bj [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 11, 2003 11:28 AM To: [EMAIL PROTECTED] 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 PROTECTED] ____ � 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]
