Forum Moderators: coopster
here is the form code created by PHP:
print "<select name='".$l."'>";
print "<option selected value='0'>0</option><option value='0'>--</option>";
for($m=1;$m<=10;$m++){
print "<option value='".$m."'>".$m."</option>";
}
//$m is value for option
//$l is a unique variable for this pull down
here is page that takes form info. and puts into an array:
while (list ($key, $val) = each ($HTTP_POST_VARS)){
//add the form values except for the $user_id
if($val!=$_SESSION['user_id']){
array_push($array_temp,$val);
}}
Here is the variable dump for that array:
array(21) { [0]=> string(9) "BBG-A4055" [1]=> bool(false) [2]=> ...bunch more variables
____________________________________
It returns a submitted value of '0' no problem, but anything other than '0' is stores some boolean value. Anyone know why this is? I had it working before and must have changed something, but I am stumped :(
if($val!=$_SESSION['user_id']){
array_push($array_temp,int($val));
}
added:
Actually, that won't work because it'll make all the vars int, and you have strings in there too.
You'll have to test for the problem var and then only apply the int type to it.
if($val!=$_SESSION['user_id']){
if($key == "dropdown name") array_push($array_temp,int($val));
else array_push($array_temp,$val);
}
Hope it helps.