well, checkbox has name and value which you can easily set.
To get the value of the checkbox, you can just do it the normal way as what you have done to text-fields and frens...
$checkb=$_POST['checkbName'];
print "The value of the check box is " . $checkb;
To write to a file, just use file system function. You know, fopen, fwrite, fread, and so on.