[LON-CAPA-dev] Re: [LON-CAPA-cvs] cvs: loncom /auth lonacc.pm
Guy Albertelli II
lon-capa-dev@mail.lon-capa.org
Mon, 25 Feb 2002 16:59:50 -0500 (EST)
Actually to be even closer to the request
this code will put a value in form.$name and a perl array will be in
form.$name[]
if ($ENV{"form.$name"}) {
if (defined($ENV{'form.'.$name.'[]'} })) {
#already have multiple values
push(@{ $ENV{'form.'.$name.'[]'} },$value);
} else {
#first multiple values, create an array
push(@{ $ENV{'form.'.$name.'[]'} },$ENV{"form.$name"},$value);
}
} else {
$ENV{"form.$name"}=$value;
}
my @localarray=@{ $ENV{'form.'$name.'[]'} };
--
albertel@msu.edu BM: n^20 t20 z20 qS
Guy Albertelli -7-9-8- O-
I would love to but . . . it wouldn't be fair to the other Beautiful
People.