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 .= "&".$
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 .=
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
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
4 matches
Mail list logo