Web Hosting Talk







View Full Version : php savy people! help!


chuckt101
07-18-2001, 09:23 AM
Hey, i'm new to php.. how do I loop through all variables passed with the post action in a form?

forexample, say i have this:

form action=process.php method=post
input type=text name=field1
input type=text name=field2
input type=text name=field3
...
input type=text name=field55
input type =submit value=go

(i left the html bracket things out because i dont know if this forum will accept that ;))

Now I want to loop through all of those variables instead of
$field1, $field2... etc...

(and note i dont want to use an array for the field either..)
I know how to do this in perl, but not php! HELp!!
:bawling:

Marty
07-18-2001, 09:29 AM
while(list($key, $val) = each ($HTTP_POST_VARS)) {
echo "$key is $val<br>";
}