Hi,
Two things I want to tell you.
1. the code that you have written will store the last value in session variable a1.
so your code should be something like this.
while($row = mysql_fetch_array($result)) { ?><input type="Checkbox" id="a[]" value="servicec"><?echo $row['servicec']; echo ""; $a[i]=$row['servicec']; $i++;
}
$_SESSION['a1']=$a;
2. As per your requirement, the clicking event is client side event, so you can not directly modify the array stored in session.
for that you will either need to use AJAX or you will need to post this page and then in next page you can catch the checkboxes values which were clicked on previous page.