获取数据库中数据的输出状态

I have a problem with getting results with an IF condition where the data is in a database.

The data is checkbox-submitted data. If users check the checkbox, then the value is "yes." When users uncheck the checkbox, then the value is '' (empty).

Let's say that the checkbox data is : $checkbox And I have conditional with PHP like the code below. I want to show the header of website based on the checkbox status using these conditions:

  1. If $checkbox is set to be 'yes' then the header is show.
  2. If $checkbox is not set before (there is no $checkbox value in database), the header is show too.
  3. If $checkbox is '', the header is not showing.

I tried this:

if ( $checkbox == 'yes' || $checkbox == XXX ) {
    // show header
} else {
    // don't show header
}

and like this:

if ( $checkbox == 'yes' || $checkbox = undefined ) {
    // show header
} else {
    // don't show header
}

but it still doesn't work as expected: when the $checkbox is '', PHP reports that $checkbox is undefined too.

How can I check for condition (XXX) to check the data is not set before but if the $checkbox is set, the condition will be different?

Maybe as simple as:

if (isset($_POST['yourCheckboxName']) && $_POST['yourCheckboxName'] == 'yes') {
   // show header
} else {
   // don't 
}

Anyway, who's you $checkbox ?