OnClick Question

Submitted by RBatista on
Hi, I'm new here and using PHP and I have this code...
  1.  <?php
  2.    
  3.    function calcula($valor)
  4.    {
  5.            $total = $total + $valor;
  6.            echo $total;
  7.            echo "dime";
  8.    }
  9.    ?>
  10.  
  11.  
  12. <input type="checkbox" name="Book" id="Book" onclick="calcula(99.99);"/>
  13.        <label for="Book">Add this for US$99.99</label>
  14.  
  15. <input type="checkbox" name="DVD" id="DVD" onclick="calcula(15.35);"/>
  16.        <label for="DVD">Add this for US$15.35</label>
All that I want is, one somebody click at one checkbox then, at the end this value be added (or substracted if unchecked) How can I do that? Please help...