Solved

Parse Error

Posted on 2004-03-22
1
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 33

Accepted Solution

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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article discusses four methods for overlaying images in a container on a web page
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
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…

756 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