while (list($key,$value) = each($_POST) ) {

do whatever you want to do with the value
}

use $HTTP_POST_VARS in place of $_POST if using older versions of PHP.

Or, you can do something like

$MY_POST_ARRAY=Array();
while (list($key,$value) = each($_POST) ) {
$MY_POST_ARRAY[count($MY_POST_ARRAY)] = $value;
}

now you can access the POST variables like $MY_POST_ARRAY[0],
$MY_POST_ARRAY[1] etc .....

HTH
R'twick
----- Original Message ----- 
From: "Michael Milligan" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 11, 2003 1:48 PM
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?  Say something
like
> $PHP_POST_VARS[0], $PHP_POST_VARS[1], $PHP_POST_VARS[2], etc???
>
> Thanks,
> Mike
>
> Michael M Milligan
> Web Developer
> (818) 909-9209
> www.mmmilligan.com
>
>
>
>
> ____ . 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]

Reply via email to