w headzie dokumentu wrzuć sobie to (wcześniej załącz jQuery):
<script LANGUAGE="Javascript"> $(document).ready(function() {
$('.session_var_toggler').bind('change', function(){
$.post('session_var_toggle.php', {name: $(this).attr('name'), value: $(this).attr('checked') })
})
})
Checkboxy, które mają przełączać wartości sesji muszą mieć klasę 'session_var_toggler'.
Na serwerze utwórz plik o nazwie 'session_var_toggle.php', otakiej zawartości:
<?php
$_SESSION[$_POST['name']] = $_POST['value'] == 'true' ? 1 : 0;
?>
// Pomógł++
// ayeo