Hi,
I've been programming in ASP for several years and have just started with PHP. I'm trying to do something that seems like it should be very simple, but I don't understand what's going on. Using PHP 4.0.6, with register globals on:
foreach($__POST as $key => $value){
echo "$key is the field name<br>$value is the field value";
}
it seems to me should echo all the variables posted from the form on the previous page. However, instead I get "Warning: Invalid argument supplied for foreach()" . I tried with $_HTTP_POST_VARS with the same result.
On experimenting I find that e.g. "echo $_POST['BusinessName'];" returns nothing, while simply "echo $BusinessName;" does give the value of the form field on the previous page.
Can anyone explain what's going on? All I want to do is to loop through all the fields from the form to check that required fields have been filled in. I though they should all be in the $_POST array ... Help!