> 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
> wit
e code I sent earlier together with that sent by Torsten
will containg the answer.
HTH,
Michael Egan
> -Original Message-
> From: Henri Marc [mailto:[EMAIL PROTECTED]
> Sent: 21 July 2004 13:51
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Problem of a beginner with Array[Scan
"Henri marc" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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
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[].
> After submit you will receive $_POST['Grid1'] a
"Henri marc" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 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." <[EMAIL PROTECTED]> wrote:
>
> > Now, I want to know which numbers have been ch
t; 51; $i ++)
{
echo "Number $i: ";
}
echo "";
echo "";
}
HTH,
Michael Egan
> -Original Message-
> From: Henri Marc [mailto:[EMAIL PROTECTED]
> Sent: 21 July 2004 12:33
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Pro
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." <[EMAIL PROTECTED]> 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
Hey John, maybe you should ask him how his script picks the winning lottery
numbers :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Tue, 20 Jul 2004 20:09:33 +0200 (CEST), Henri Marc
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm just starting with PHP and I have a problem. This is certainly very easy for you
> but for me, it's tough.
>
> I want to make a lottery site (just as an exercise), so I made a page with 6 grids
> o
Henri Marc wrote:
I want to make a lottery site (just as an exercise), so I made a page with 6 grids of 50 numbers each (check boxes).
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...
I
You don't have to declare an array size in PHP.First you can do this:
$arr = array();
then
$arr[1] = 50;
$arr[2] = true;
$arr[3] = "some value";
or you can loop through
foreach( $i = 0; $i < 50 ; $i++ )
$arr[$i] = false;
I believe you can assign the checkbox names in HTML as grid[] and in p
Name each of the checkboxes "grid[]" (Your Text), then in your processing script,
$_POST['grid'] will be an array with the values of all the checked boxes
(assuming at least one was checked - otherwise it won't be set). If you
want a limit on the number of boxes you can check, try a little Javascr
> 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.
--
PHP General Mailing List (http://www.
13 matches
Mail list logo