At 3:07 PM -0700 1/24/01, 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.
>

reset($HTTP_GET_VARS);
while (list($VariableName, $VariableValue) = each($HTTP_GET_VARS))
{
echo "GET variable $VariableName was set to $VariableValue<br>\n";
}

Of course, you would want to do your own processing in place of the echo.

If you want to use POSTed or cookie variables, replace the _GET_ in 
the above snippet with _POST_ or _COOKIE_, respectively.

The reset(), by the way, resets the array pointer to the beginning of 
the array. It's not always needed, but I tend to do it anyway. It IS 
necessary, however, ig you use the above snippet within an enclosing 
loop.


        - steve

-- 
+--- "They've got a cherry pie there, that'll kill ya" ------------------+
| Steve Edberg                           University of California, Davis |
| [EMAIL PROTECTED]                               Computer Consultant |
| http://aesric.ucdavis.edu/                  http://pgfsun.ucdavis.edu/ |
+-------------------------------------- FBI Special Agent Dale Cooper ---+

-- 
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]

Reply via email to