Link to home
Start Free TrialLog in
Avatar of Wraith10
Wraith10Flag for Canada

asked on

Parse Error

Arg I got dumped with a spring break assignment and I have no way of getting help in class and I can't figure out what's wrong with this thing for the life of me, it's my first php project.

There's an html form that processes to a php page to calculate prices. The error I get is: \Parse error: parse error, expecting `','' or `';'' in /home/virtual/site54/fst/var/www/html/processingorder.php on line 42

here's the php code I marked line 42:


<?
echo "<P>Order Processed.";
echo date("H:i, jS F");
echo "<br>";
echo $flour." bags of flour<BR>";
echo $juice." cartons of juice<BR>";
echo $chicken." roast chickens<BR>";
echo $donut." containers of donuts<BR>";
echo $cereal." boxes of cereal<BR>";
echo $banana." bunches of bananas<BR>";
echo $potato." sacks of pototoes<BR>";
echo $gum." packages of bubble gum<BR>";
echo $peas." bags of frozen peas<BR>";
echo $cheese." blocks of cheese<BR>";

$totalqty = 0;
$totalamount = 0.00;

define("FLOURPRICE", 25);
define("JUICEPRICE", 5);
define("CHICKENPRICE", 18);
define("DONUTPRICE", 1);
define("CEREALPRICE", 8);
define("BANANAPRICE", 2);
define("POTATOPRICE", 11);
define("GUMPRICE", 1);
define("PEASPRICE", 6);
define("CHEESEPRICE", 14);

$totalqty = $flour + $juice + $chicken + $donut + $cereal + $banana + $potato + $gum + $peas + $cheese;
$totalamount = $flour * FLOURPRICE
+ $juice * JUICEPRICE
+ $chicken * CHICKENPRICE + $donut * DONUTPRICE + $cereal * CEREALPRICE + $banana * BANANAPRICE + $potato * POTATOPRICE + $gum * GUMPRICE + $peas * PEASPRICE + $cheese * CHEESEPRICE;


$totalamount = number_format($totalamount, 2);
echo "<BR>\n";
echo "Items ordered: ".$totalqty."<br>\n;

$totalamount = $totalamount;
$totalamount = number_format($totalamount, 2);
echo "Total Including Tax: $".$totalamount."<BR>\n";  //This is line 42
?>
ASKER CERTIFIED SOLUTION
Avatar of snoyes_jw
snoyes_jw
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial