The PHP solution assumes that you submitted a form with a checkbox. If you want live results (as soon as it's clicked, an event is triggered), you need to use JavaScript.
PHP solution:
PHP Code:
<?php
if(isset($_POST['chkbx'])) {
echo "Checkbox was set";
}
?>
<input type="checkbox" name="chkbx" value="1" />
JavaScript solution:
Code:
<script type="text/javascript">
function isChecked(obj) {
if(obj.checked === true) {
// Perform event.
}
}
</script>
<input type="checkbox" name="chkbx" value="1" onclick="isChecked(this)" />
Bookmarks