Re: Problem of a beginner with Array

From: Date: Wed, 21 Jul 2004 13:05:17 +0000
Subject: Re: Problem of a beginner with Array
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-191309@lists.php.net to get a copy of this message
"Henri marc" <mesmlamoi@yahoo.fr> wrote in message news:20040721125038.59916.qmail@web50104.mail.yahoo.com... > Hello Torsten, > > > try this: > > > > input name="Grid1[1]" type"checkbox" file://1st > > grid, 1st checkbox > > input name="Grid1[2]" type"checkbox" file://1st > > grid, 2nd checkbox... > Seems I can't do another way than this. Not possible > to do just Grid1[]. With Grid1[] how can you distinguish between the checkboxes? > > > After submit you will receive $_POST['Grid1'] as an > > ARRAY containing all > > indices of the checked checkboxes. Then loop through > > it and do what ever you > > want: > > > > foreach ($_POST['Grid1'] as $value) { > > > > echo $value; > > } > So, I did it like you said but the result of echo > $value is "on" not the checkedbox number. Try print_r($_POST['Grid1']); at the top of your second page (where the form action points to). Torsten

« previous php.general (#191309) next »