Re: [PHP] Looping through variables

2001-04-24 Thread Ashley M. Kirchner
Dan Lowe wrote: > // List of variable names > $var_list = array ( 'var1', 'var2', 'var3', 'var4' ); > > while (list($key,$val) = each($var_list)) { > if ($$val == '') { > $url .= "&".$val."="; > $error = 1; > } else { > $url .= "&".$

Re: [PHP] Looping through variables

2001-04-23 Thread Dan Lowe
Previously, Ashley M. Kirchner said: > > I have a bunch of variables (through a POST form) that I need to > loop through and check for content. Right now, each one is being > evaluated separately: > > if ($var1 == '') { > $url .= "&var1="; > $error = 1; > } else { > $url .=

Re: [PHP] Looping through variables

2001-04-23 Thread Phillip Bow
All of the POST variables will be stored in the HTTP_POST_VARS array which you can loop through once rather than manually doing each seperate variable. -- phill ""Ashley M. Kirchner"" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > I have a bunch of varia

[PHP] Looping through variables

2001-04-23 Thread Ashley M. Kirchner
I have a bunch of variables (through a POST form) that I need to loop through and check for content. Right now, each one is being evaluated separately: if ($var1 == '') { $url .= "&var1="; $error = 1; } else { $url .= "&var1=".urlencode(stripslashes($var1)).""; } Then