#7934 [Csd]: HTTP_POST_VARS unable to handle same key multiple times
| From: | bzeeb+php at zabbadoz dot net | Date: | Thu, 12 Sep 2002 14:29:41 +0000 |
| Subject: | #7934 [Csd]: HTTP_POST_VARS unable to handle same key multiple times | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-19247@lists.php.net to get a copy of this message | ||
ID: 7934
User updated by: bzeeb+php@zabbadoz.net
Reported By: bzeeb+php@zabbadoz.net
Status: Closed
Bug Type: Variables related
Operating System: FreeBSD
PHP Version: 4.0.3
New Comment:
please STOP this discussion here.
This bug-ID is _Closed_.
Either reopen or use a mailinglist...
Previous Comments:
------------------------------------------------------------------------
[2002-09-12 08:22:27] m.ford@lmu.ac.uk
Or you can use the feature of JavaScript that, *by* *definition*
a.b
is identical to
a['b']
so you could refer to
document.myform['mycheckbox[]'].length
------------------------------------------------------------------------
[2002-09-05 17:25:02] rasmus@php.net
Every JS element has a numerical index number. You do not have to use
the name at all which allows you to call things whatever you want.
------------------------------------------------------------------------
[2002-09-05 16:59:05] dyonn@sympatico.ca
Correct me if I'm wrong, but I actually think this is a bug because
adding [] to the NAME of the checkbox makes the object to be
unaccessible throught javascript(or really hard to access).
document.myform.mycheckbox[].lenght will give syntax error.
I browsed quite a lot on the net and I havent found the way to play
with a JS variable named something[]
------------------------------------------------------------------------
[2002-07-30 11:52:21] hholzgra@php.net
to chrisrivera@chrisrivera.com:
by giving the [] you specify that you *want*
an array while creating one auto-magicaly
whenever multiple values exists may confuse
form processing code as input variables may
be string or array depending on number of
selections made
to olivierdsm@hotmail.com:
this will do the trick for you:
"... IN (".join(",",$inmailtoupdate).") "
(but make sure $inmailtoupdate is not empty() before you do so)
please direct further questions to the php-general mailing list as we
are no longer talking about bugs here
------------------------------------------------------------------------
[2002-07-30 09:31:51] olivierdsm@hotmail.com
This is what i codded :
<input type="checkbox" name="inmailtoupdate[]" value="<? echo
$row['admins_id']; ?>">
then :
$SQL = "update admins set admins_inmail='yes' where admins_id in
($inmailtoupdate)";
--> this is what i get as error message : "Unknown column 'Array' in
'where clause'
so, ok i can write something like echo inmailtoupdate[1], but how do i
get the complette list???
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/7934
--
Edit this bug report at http://bugs.php.net/?id=7934&edit=1