I can loop through all the post variables like
but now I also post a variable that I don't want to include in this loop.
I have a var called $country which comes from a select list but when the country is not in the list I like to add it with a field called $newcountry
before the loop starts I want to transfer the value of $newcountry to $country and remove $newcountry from the post array??
is this possible and then how ??
Code:
while ( list($field, $value) = each ($HTTP_POST_VARS)) {
if ($field <> "Submit" ){
if (is_array($value)){
$arrayLength = count($value);
$temparray=array_values($value);
for ($i = 0; $i < $arrayLength; $i++){
$temp=$temp .$temparray[$i] ."#";
}
$fieldlines=$fieldlines .$field ."='" .$temp ."',";
$temp="#";
}else{
$fieldlines=$fieldlines .$field ."='" .$value ."',";
}
}
}
but now I also post a variable that I don't want to include in this loop.
I have a var called $country which comes from a select list but when the country is not in the list I like to add it with a field called $newcountry
before the loop starts I want to transfer the value of $newcountry to $country and remove $newcountry from the post array??
is this possible and then how ??