22
what's wrong with having checkbox as an array?

Oh wait... I can see at least one problem.
But do remember two things:
1) Initiate $xm ($xm = 0 somewhere above the loop)
2) Send $xm as a hidden variable, so you can have a for-loop on the receiving page