Solved

Parse Error

Posted on 2004-03-22
1
223 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 50 total points
Comment Utility
Missing quote on this line (38?)
echo "Items ordered: ".$totalqty."<br>\n;
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now