----- 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]

Reply via email to