Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Parse Error

Posted on 2004-03-22
1
Medium Priority
?
232 Views
Last Modified: 2012-05-04
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
?>
0
Comment
Question by:Wraith10
1 Comment
 
LVL 33

Accepted Solution

by:
snoyes_jw earned 200 total points
ID: 10653342
Missing quote on this line (38?)
echo "Items ordered: ".$totalqty."<br>\n;
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question