Assuming you are using GET (since you have a QUERY_STRING in url) :
foreach ($HTTP_GET_VARS as $key => $value) {
print "<br>$key is $value \n";
}
For form you can use POST and loop through HTTP_POST_VARS too. These
are predefined variables :
http://www.php.net/manual/en/language.variables.predefined.php
That should get you started :-) Foreach is php4+ specific, manual has
examples using a while loop too, see :
http://www.php.net/manual/en/control-structures.foreach.php
Note that if you're passing arrays through your forms (which everyone
should do!!!) then adjust accordingly. A quick method to just view
(dump) the data is using :
print_r($SOME_SPIFFY_VARIABLE_ARRAY);
-OR-
var_dump($A_HUGE_ARRAY_TO_DISPLAY);
Those are two very beautiful functions to play with, for debugging and
such. Viewing $HTTP_GET_VARS through them will quickly show you what is
passing. I recommend surrounding those "debugging functions" with <pre>
as it creates a much prettier output to browser. But I digress.
Oh, phpinfo() will tell you which predefined variables you get to play
with as each server is setup differently.
Regards,
Philip Olson
On Wed, 24 Jan 2001, Karl J. Stubsjoen wrote:
> What is the simplest way to set up a procedure to loop through all passed
> querystring values and/or form values?
>
> I'm very new to PHP, and don't know how to set up loops at all.
>
> Thanks! Karl
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]