The trick is to make the name of the checkbox an array:
code:
<input type="checkbox" name="my_check[1]" /> 1<br />
<input type="checkbox" name="my_check[2]" /> 2<br />
ETC.
and then process it on the page you send the data to like:
code:
if (is_array ($my_check)) {
while (list ($key, $value) = each ($my_check)) {
$data .= "$key, ";
}
}
Adapt the name and who you want the data outputted and you'll be away.
---------------------
Note:
You can also set the values this way too (I'm not aware of any differences in performance between the 2 methods):
code:
<input type="checkbox" name="my_check[]" value="1" /> 1<br />
<input type="checkbox" name="my_check[]" value="2" /> 2<br />
ETC.
_________________________
Emperor
(Added by: Emperor on Wed 23-Oct-2002)
(Edited by: Emperor on Fri 25-Oct-2002)
|