My question is that first i need to create the 10 checkboxes which i have already done and then when i set the value of any of the checkboxes as checked, it should be saved in a session after clicking on the submit button.After clicking on the submit button the values of the checkboxes that were checked should remain checked and should not be reset.And then after checking the values of checkboxes time and again on clicking on submit button, the checked values should be saved in session again such that the duplicate values are not allowed in the session. Since i am novice in php i have tried a lot but without success,

Member Avatar
$total = (isset($_POST['mycheck'])) ? array_sum($_POST['check10']) : 0;
$output = "";
$label = array("item 1","prize 2"," fallow 3"," round 4","prism 5","echo 6"," tango 7","ent 8","thorn 9"," elbow 10");
	$bt = pow(2,$x);
	$chk = ($total & $bt) ? ' checked="checked"' : '';
	$output .= "<input id=\"item_$x\" type=\"checkbox\" name=\"mycheck[]\" value=\"$bt\"$chk /> <label for=\"item_$x\">{$label[$x]}</label>\n";


<form method="post">
<?php echo $output;?>
<input type="submit" value="sub" />

You could save to session too:

if($total)$_SESSION['form_total'] = $total;

remember the