[PHP] SELECT MULTIPLE form variable?
Hi all, So I was under the impression that an HTML form SELECT MULTIPLE item would return an array with all of the selected items. This array can then be used with any of the standard PHP array functions, yes? I have 1 HTML page that seems to work fine... However, another page that is nearly identical is failing - giving me the following error: Wrong datatype for second argument in call to in_array. When I look at the variable, it seems to ONLY contain a string - the first item the user selected. The only difference I can see is that the working SELECT MULTIPLE has numerical values, and the dysfunctional one uses string values - but the values ARE enclosed in quotation-marks... so I don't know why they're not POSTing properly as an array. Is this a known bug or issue? Any thoughts or solutions? Thanks a bunch, take care, --Noel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SELECT MULTIPLE form variable?
You need to name it formfield[], not formfield. Noel Wade wrote: Hi all, So I was under the impression that an HTML form SELECT MULTIPLE item would return an array with all of the selected items. This array can then be used with any of the standard PHP array functions, yes? I have 1 HTML page that seems to work fine... However, another page that is nearly identical is failing - giving me the following error: Wrong datatype for second argument in call to in_array. When I look at the variable, it seems to ONLY contain a string - the first item the user selected. The only difference I can see is that the working SELECT MULTIPLE has numerical values, and the dysfunctional one uses string values - but the values ARE enclosed in quotation-marks... so I don't know why they're not POSTing properly as an array. Is this a known bug or issue? Any thoughts or solutions? Thanks a bunch, take care, --Noel -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SELECT MULTIPLE form variable?
Its the littlest things that kill ya Thanks a ton! As a side note, I definitely do NOT have the brackets on the working page - so its an undefined feature (or bug) that numerical-value SELECT MULTIPLE variables post as an array to PHP. Take care, and thanks again! --Noel - Original Message - From: Leif K-Brooks [EMAIL PROTECTED] To: Noel Wade [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, June 14, 2003 1:26 PM Subject: Re: [PHP] SELECT MULTIPLE form variable? You need to name it formfield[], not formfield. Noel Wade wrote: Hi all, So I was under the impression that an HTML form SELECT MULTIPLE item would return an array with all of the selected items. This array can then be used with any of the standard PHP array functions, yes? I have 1 HTML page that seems to work fine... However, another page that is nearly identical is failing - giving me the following error: Wrong datatype for second argument in call to in_array. When I look at the variable, it seems to ONLY contain a string - the first item the user selected. The only difference I can see is that the working SELECT MULTIPLE has numerical values, and the dysfunctional one uses string values - but the values ARE enclosed in quotation-marks... so I don't know why they're not POSTing properly as an array. Is this a known bug or issue? Any thoughts or solutions? Thanks a bunch, take care, --Noel -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php