Need some help guys I'm working on a order form using Php, I have the function correct because it works fine when I just echo it out. But I can't figure out how to call the function correctly into my div on my table. I want to be able to display the result of quantity times price. Any help would be greatly appreciated.
<?
/*
print_r($_POST)
*/
$firstName = $_POST["firstName"];
$lastName = $_POST["lastName"];
$phone = $_POST["phone"];
$email = $_POST["emailAddress"];
$appleQuantity = $_POST["apple"];
$baconQuantity = $_POST["bacon"];
$breadQuantity = $_POST["bread"];
$cheeseQuantity = $_POST["cheese"];
$eggsQuantity = $_POST["eggs"];
$hamQuantity = $_POST["ham"];
$milkQuantity = $_POST["milk"];
$priceApples = 10;
$priceBacon = 2.5;
$priceBread = 5;
$priceCheese = 5;
$priceEggs = 3.6;
$priceHame = 6;
$priceMilk = 4;
function subTotal($incomingQuantity , $incomingPrice)
{
return $incomingQuantity * $incomingPrice;
}
?>
<div align="center"><? subTotal($incomingQuantity , $incomingPrice ) ?></div>
echo? Just a idea...<?= subTotal($incomingQuantity , $incomingPrice ) ?>simple as adding an equal sign; assuming short tags are set/on. ;-)