Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Colin
Example: I have a page with multiselect, which name is SEL1 (I cannot use square brackets because I need to use a JavaScript on the page, so, it's not allowed in variable names to contain [ ] ). Sure it is allowed: http://ca.php.net/FAQ.php#7.14 - Colin -- PHP Development Mailing List

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Max Vysotskiy
Thanx But why not just to convert plain field names without [] to arrays?? Is there any reasons to not doing this? Colin [EMAIL PROTECTED] wrote in message 9dec79$aa9$[EMAIL PROTECTED]">news:9dec79$aa9$[EMAIL PROTECTED]... Example: I have a page with multiselect, which name is SEL1 (I

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Andrei Zmievski
On Thu, 10 May 2001, Max Vysotskiy wrote: Thanx But why not just to convert plain field names without [] to arrays?? Is there any reasons to not doing this? That's been a pet peeve of mine as well. I think that if PHP sees multiple variables with the same name in POST data, it should make an

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Max Vysotskiy
Andrei Zmievski [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... That's been a pet peeve of mine as well. I think that if PHP sees multiple variables with the same name in POST data, it should make an array out of them.. And in GET data either I think. Why

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Max Vysotskiy
Well. It could be prevented with some directive. Something like ?php_convert_multiple_to_array? :-))) Adam Wright [EMAIL PROTECTED] wrote in message 001f01c0d969$6494ca00$8d010a0a@griffin">news:001f01c0d969$6494ca00$8d010a0a@griffin... Just from my point of view, I've got a lot of legacy code

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Andrei Zmievski
On Thu, 10 May 2001, Max Vysotskiy wrote: Well. It could be prevented with some directive. Something like ?php_convert_multiple_to_array? Or php.ini setting. -Andrei Linux is like living in a teepee. No Windows, no Gates, Apache in house. - Usenet signature -- PHP

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Andi Gutmans
At 07:02 PM 5/10/2001 +0300, Max Vysotskiy wrote: Well. It could be prevented with some directive. Something like ?php_convert_multiple_to_array? :-))) This kind of directive is evil and should never have been introduced :) Andi -- PHP Development Mailing List http://www.php.net/ To

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Zeev Suraski
] Cc: [EMAIL PROTECTED] Sent: Thursday, May 10, 2001 4:39 PM Subject: Re: [PHP-DEV] multiselects and arrays On Thu, 10 May 2001, Max Vysotskiy wrote: Thanx But why not just to convert plain field names without [] to arrays?? Is there any reasons to not doing this? That's been a pet

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Andrei Zmievski
On Thu, 10 May 2001, Zeev Suraski wrote: Why does it make more sense? Is there any advantage in using this over using foo[]? By changing this behavior, we're actually losing functionality, not adding any. Interaction with Javascript is problematic if you use [] in the variable name.

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Max Vysotskiy
Andrei Zmievski [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... On Thu, 10 May 2001, Zeev Suraski wrote: Why does it make more sense? Is there any advantage in using this over using foo[]? By changing this behavior, we're actually losing functionality,

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Zeev Suraski
At 19:20 10/5/2001, Andrei Zmievski wrote: On Thu, 10 May 2001, Zeev Suraski wrote: Why does it make more sense? Is there any advantage in using this over using foo[]? By changing this behavior, we're actually losing functionality, not adding any. Interaction with Javascript is

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Max Vysotskiy
Well You can use something like this: variable = documents.forms[0].elements['foo[]']; Zeev Suraski [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... At 19:20 10/5/2001, Andrei Zmievski wrote: On Thu, 10 May 2001, Zeev Suraski wrote: Why does it make more

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Andrei Zmievski
On Thu, 10 May 2001, Zeev Suraski wrote: With no easy workaround such as \[\] or something like that? I don't think so. -Andrei * Lack of planning on your part doesn't constitute an emergency on my part. * -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread derick
On Thu, 10 May 2001, Andrei Zmievski wrote: On Thu, 10 May 2001, Max Vysotskiy wrote: Well. It could be prevented with some directive. Something like ?php_convert_multiple_to_array? Yeah, another ini directive that makes it very hard to make scripts compatible for multiple servers...

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Rose, Billy
You can iterate through document.FORMNAME.elements if you need to access them. Changing the bracket notation would not be needed. Colin [EMAIL PROTECTED] wrote in message news:9dec79$aa9$[EMAIL PROTECTED]... Example: I have a page with multiselect, which name is SEL1 (I cannot use square

Re: [PHP-DEV] multiselects and arrays

2001-05-10 Thread Colin Viebrock
What I do when I need multidimensional arrays from forms, is name my variables: INPUT NAME=i::foo::bar VALUE= ... i.e., I delimit the dimensions with ::. Then, on the page they are posted to, I do: ? parseInputVars('i'); ? And here is the code for that function, which looks for all