Re: Problem of a beginner with Array
| From: | Henri Marc | Date: | Wed, 21 Jul 2004 11:33:29 +0000 |
| Subject: | Re: Problem of a beginner with Array | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191298@lists.php.net to get a copy of this message | ||
Hello,
Thank you very much for all the people who replied me
so fast.
Unfortunately I still have a problem with that part.
"Matt M." <h.dudeness@gmail.com> wrote:
> Now, I want to know which numbers have been checked
by the player.
> I have a :
> "input name="Grid1" type="checkbox"
> for the first grid. Grid2 for the grid #2...
>if the user checks any Grid1[] boxes then
$_POST['Grid1'] will be an array and so on.
I want to avoid to have to name each check box like
this:
Grid[1][1] //1st checkbox of the first grid
Grid[1][2] //2nd checkbox of the first grid and so on
I would prefer to have if possible:
input name="Grid1[]" type"checkbox" //1st grid, 1st
checkbox
input name="Grid1[]" type"checkbox" //1st grid, 2nd
checkbox...
That's what Matt M proposed.
If I do: echo $_POST['Grid1'];
I have "on" as a result and not a value. I also tried
with echo $_POST['Grid1[]']; and other similars but I
have an error message "undefined index", or "array".
Thanks again.
Dave
Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/
Yahoo! Messenger: dialoguez instantanément avec vos amis. Téléchargez GRATUITEMENT sur http://fr.messenger.yahoo.com