This is the way I do it.
First Page.
<?
print("<FORM ACTION=\"page_2.php\" METHOD=\"post\">");
print("<input type=\"checkbox\" name=\"selected[]\" value=\"Red\">Red<BR>");
print("<input type=\"checkbox\" name=\"selected[]\" value=\"Blue\">Blue<BR>");
print("<input type=\"checkbox\" name=\"selected[]\" value=\"Teal\">Teal<BR><BR>");
print("<INPUT TYPE=\"submit\" value=\"GO!\">");
print("</FORM>");
?>
Second Page.
<?
$selected = $_POST['selected'];
print("You Selected:<BR>");
for ($i=0; $i < sizeof($selected); $i++)
{
print("$selected[$i] - ");
}
?>
There You Go!
I Hope it works for you, you can use the for statement to create the checkbox's each with a value of how far down it is on the for statement like this.
First Page Revised.
<?
$checkboxs = array("First Checkbox", "Second Checkbox", "Third Checkbox");
print("<FORM ACTION=\"page_2.php\" METHOD=\"post\">");
for($i = 0; $i < count($checkboxs); $i ++)
{
print("<INPUT TYPE=\"checkbox\" NAME=\"selected\"
VALUE=\"$checkboxs[$i]\">$checkboxs[$i]<BR>");
}
print("<INPUT TYPE=\"submit\" value=\"GO!\">");
print("</FORM>");
?>
There You Go! Happy Programing