If a checkbox is not checked then
nothing at all is posted-back: the post value will not be set (or even exist).
POST data are strings (or arrays of strings), unless you do some conversion to a number, etc., so you should compare against '1'.
PHP Code:
if (isset($_POST['selectAll']) && !empty($_POST['selectAll']) && $_POST['selectAll'] == '1') {
Most people tend to omit the second of these tests. But we can now do:
PHP Code:
if ($_POST['selectAll'] && $_POST['selectAll'] == '1') {
where the first expressions says, effectively, "it exists and has a value"; that is, a value other than a falsy-value.