Here's a way to put your prices into the while statement and have them added up into a Total. Then you could use the Total to process a payment.
Pete
<?
reset($POST);
while (list($key, $val) = each($POST)) {
//Define a price for each extension with if statements.
if ($key =="com") {
$val="50.00";
$total = $total + $val; //$total is added up with each if statement ...
}
if ($key =="net") {
$val="60.00";
$total = $total + $val;
}
if ($key =="org") {
$val="45.00";
$total = $total + $val;
}
//Print out the domains and their new values
echo "$key => $val<br>";
}//Close while loop
//Format combined Total so it has two decimal places.
$total = number_format($total, 2);
//Print out the Total
echo "Total: $total";
//Use your $total to send to where ever you like.
?>