Many thanks!!  One thing I do not understand in the "types" of variables is the use and referencing of a variable with the "[]".  What I usually do is define a variable as

$myvar = array();

And then I use the "[]" to refer to the elements.  However, if I understand you suggestion, which works like a champ, the use of the "[]" tells the interpreter to treat $myvar as an array.

Todd

Marco Tabini wrote:
Sure! Just add [] to the end of the name of the field. PHP will return
all the values in an array:

<select name="myvar[]">


Marco
  



Subject:
[PHP] Multiple selections
From:
Todd Cary <[EMAIL PROTECTED]>
Date:
Tue, 12 Nov 2002 16:37:43 -0800
To:
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]>

I have a pull-down with the MULTIPLE attribute.  If the Form is of Type GET and two values are selected (e.g. select1 and select2), I see in the URL the following:

?myvar=select1&myvar=select2

"myvar" appears twice, however, if I check the $HTTP_GET_VARS, I only have one value: myvar=select2.

Is it possible to get both values?

Todd



--
Ariste Software, Petaluma, CA 94952

Reply via email to