php calculate

Posted on 16th Feb 2014 by admin

this code echoes correctly the sum but the inserted result is 0??
Code: <?php
$TotalNumberAdults=$_POST['TotalNumberAdults'];
$TotalNumberChildren=$_POST['TotalNumberChildren'];
$TotalNumber=($TotalNumberAdults + $TotalNumberChildren);

?><?php echo sprintf($TotalNumber);?>
<input name="TotalNumber" type="hidden" value="<?php echo sprintf($TotalNumber);?>" size="7">

Other forums