Note the following: (from:
http://us.php.net/manual/en/function...diff-***oc.php)
$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
$array2 = array("a" => "green", "yellow", "red");
$result = array_diff_***oc($array1, $array2);
print_r($result);
returns:
Array
(
[b] => brown
[c] => blue
[0] => red
)
If you have your script generate a php array that has all the checkbox
names as array values at the same time that it is generating the
checkbox html name attribute values, then you can make the above
comparison between the array you have created and the $_POST array.
The result will be an array of the names of the checkboxes that are
not checked. You can then extract them from this array as you desire
for whatever purpose you need them.
--Kenoli
On May 28, 11:51 am, stephe...@rogers.com (Stephen) wrote:
> Søren Neigaard wrote:
> > I would like to have a unknown number of generated check boxes like this:
>
> > <input type="checkbox" name="chk01" />
> > <input type="checkbox" name="chk02" />
> > <input type="checkbox" name="chk0X" />
>
> > And the name will be generated "chk01 to chk99", but how do I make the
> > receiving PHP script that "scans" for post variables that are sent, so
> > that I can work on this information?
>
> The form posting agent will only return values for boxes that are checked.
>
> You can do isset in a loop up to the maximum possible value.
>
> But I suspect that you are generating the form dynamically. If that is
> the case, add a hidden input with a value of the number of checkboxes.
> That would be the upper limit of your loop.
>
> Stephen