I wanted a "site is disable" feature so I created an int(1) field named disable_site.
echo "<TR><TD class='row1'>Disable Site<br><span class='gensmall'>Only Administrators will have access.</span></TD><TD class='row2'><input type='checkbox' name='disable_site' $site_status></TD></TR>";
I check the value this way.
$disable_site = $info['disable_site'];
if ($disable_site) {
$site_status = 'checked';
}
I seem not to be able to update this field from the form. Every other field on the form is working, but this one will not update.
echo"<pre>";
print_r($_POST);
echo"</pre>";
gives me [disable_site] => on
Why wouldn't this be a '1' instead of 'on' or at least a TRUE? How can I update an int(1) field with this?
If I do this..
$disable_site = intval($_POST['disable_site']);
I get 0
I'm confused. 😕