The button to calculate totals would be better done in javascript, so it can show the totals on-screen to the customer before they submit.
Otherwise, if you don't want to use javascript, take out the first button and leave just the submit button.
On your processor page, have it total all the form values in PHP:
$totalPrice = $_POST['price1'] + $_POST['price2'] + $_POST['price3'];
and echo that $totalPrice out with a link to a confirm purchase page.