input type=checkbox name=groups[] value=1 checkednbsp; blah1br
input type=checkbox name=groups[] value=2 checkednbps; blah2br
input type=checkbox name=groups[] value=3 checkednbsp; blah3br
I can't seem to access that data correctly when that form gets submitted.
I have tried:
$groups[] =
$groups = $_POST['groups'];
or
if(isset($_POST['groups']) is_array($_POST['groups']))
$groups = $_POST['groups'];
else
$groups = array();
so that groups is an (empty) array even if no checkboxes were checked
mh.
On Wed, 12 Jun 2002, Adam Plocher wrote:
input type=checkbox
Hi Adam:
On Wed, Jun 12, 2002 at 01:15:03PM -0700, Adam Plocher wrote:
input type=checkbox name=groups[] value=3 checkednbsp; blah3br
$groups[] = $_POST['groups[]'];
This is just wrong.
$groups[] = $_POST['groups'];
This assigns the global groups array to one element in a local groups
...
-Original Message-
From: Adam Plocher [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 12, 2002 4:15 PM
To: [EMAIL PROTECTED]
Subject: [PHP] POST Arrays with register globals..
input type=checkbox name=groups[] value=1 checkednbsp;
blah1br
input type=checkbox name=groups[] value=2 checkednbps
4 matches
Mail list logo