Re: Looping through variables

From: Date: Mon, 23 Apr 2001 19:42:51 +0000
Subject: Re: Looping through variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-49919@lists.php.net to get a copy of this message
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"" <ashley@pcraft.com> wrote in message news:3AE4853B.9309A7CA@pcraft.com... > > 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 repeat for $var2, $var3, etc., etc... > > Is there a better way of doing this looping instead of writing the > same routine over and over again? > > AMK4 > > -- > H | Hi, I'm currently out of my mind. Please leave a message. BEEEEP! > |____________________________________________________________________ > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Ashley M. Kirchner <mailto:ashley@pcraft.com> . > 303.442.6410 x130 > Director of Internet Operations / SysAdmin . 800.441.3873 x130 > Photo Craft Laboratories, Inc. . eFax 248.671.0909 > http://www.pcraft.com . 3550 Arapahoe > Ave, #6 > .................. . . . . Boulder, CO 80303, U.S.A. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#49919) next »