Hi Y'all, Having a problem with post, which is driving me nuts. Basically I'm following an example out of a PHP book "PHP and MySQL Web Development" and the variables are not being passed from an HTML form to the PHP file. The HTML form is at: http://www.ensley.ca/harold/phptest/orderform.html
And the PHP file is as follows:
<html>
<head>
<title>Bob's Auto Parts - Order Results</title>
</head>
<body>
<h1>Bob's Auto Parts</h1>
<h2>Order Results</h2>
<?
echo "<p>Order processed at "; // Start printing order
echo date("H:i, jS F");
echo "<br>";
echo "<p>Your order is as follows:";
echo "<br>";
echo $tyreqty." tyres<br>";
echo $oilqty." bottles of oil<br>";
echo $sparkqty." spark plugs<br>";
$totalqty = 0;
$totalamount = 0.00;
define("TYREPRICE", 100);
define("OILPRICE", 10);
define("SPARKPRICE", 4);
$totalqty = $tyreqty + $oilqty + $sparkqty;
$totalamount = $tyreqty TYREPRICE
+ $oilqty OILPRICE
+ $sparkqty * SPARKPRICE;
echo "<br>\n";
echo "Items ordered: ".$totalqty."<br>\n";
echo "Subtotal: $";
echo number_format($totalamount, 2);
echo "<br>\n";
$taxrate = 0.10; // local sales tax is 10%
$totalamount = $totalamount * (1 + $taxrate);
$totalamount = number_format($totalamount, 2);
echo "Total including tax: $".$totalamount."<br>\n";
?>
</body>
</html>
Not sure why this won't work. If anyone has any ideas, let me know. Thanks!