I want to sum values in a php variable from html text box my php code is as under
$total = 0;
$val2 = $_POST['val1'];
$total += val2;
echo "Sum of value is ". $total;
This is my HTML:
<form action="add.php" method="post" >
<input type="text" name="val1" />
...
...