RE: [PHP-DB] HTML Forms question...
| From: | Rich Gray | Date: | Wed, 20 Nov 2002 01:13:17 +0000 |
| Subject: | RE: [PHP-DB] HTML Forms question... | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-23483@lists.php.net to get a copy of this message | ||
If you name the checkbox as name="system[]" then PHP will automatically
create an array of the checkbox values which can be subsequently accessed
via $_POST['system'][n] - be warned however that the '[]' can screw up any
JavaScript code that refers to the checkbox object...
HTH
Rich
-----Original Message-----
From: NIPP, SCOTT V (SBCSI) [mailto:sn4265@sbc.com]
Sent: 19 November 2002 08:53
To: 'Ryan Jameson (USA)'; php-db@lists.php.net
Subject: RE: [PHP-DB] HTML Forms question...
OK. If I am using the POST method and the checkbox 'name' for all
of the checkboxes is 'system', how do I access the results? I am
researching on the PHP site trying to figure out what this array is, and how
I access this if the index name is the same for all elements. I am hoping
that this data will be in an array and I can simply loop through the
contents of the array. If this data is stored in a hash (Perl word for this
type of array, not sure if it's the same in PHP), how do I access this data
since the index for every element would be the same?
I am SURE that I am probably missing some important conceptual
issues here, but still learning as I go. Unfortunately, this probably means
that I will be completely rewriting this application at least once in the
future. Oh well, live and learn. Thanks again for the help.