Forum Moderators: coopster

Message Too Old, No Replies

Parse Error Noted In PHP Code

         

DeadlyPersona

7:20 am on Aug 25, 2007 (gmt 0)

10+ Year Member



I decided to get an example of a php code and then tweak it to benefit me at a later date. But I'm getting this error message:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\OrderProcessed.php on line 23

I understand by reading in the forums that the error may not necessarily be on Line 23. Unfortunately, I don't know where the error is. Please help :)

<?
echo "<P>Order Processed.";
echo date("H:i, jS F");
echo "<br>";
echo $tireqty." tires<BR>";
echo $oilqty." bottles of oil<BR>";
echo $sparkplugqty." spark plugs<BR>";

$totalqty = 0;
$totalamount = 0.00;

define("TIREPRICE", 100);
define("OILPRICE", 10);
define("SPARKPLUGPRICE", 4);

$totalqty = $tireqty + $oilqty + $sparkplugqty;
$totalamount = $tireqty * TIREPRICE
+ $oilqty * OILPRICE
+ $sparkplugqty * SPARKPLUGPRICE;
$totalamount = number_format($totalamount, 2);

echo "<BR>\n";
echo "Items ordered: ".$totalqty."<BR>\n;
echo "Subtotal: ".$totalamount."<BR>\n;

$taxrate = 0.10; // local sales tax is 10% here
$totalamount = $totalamount * (1+$taxrate);
$totalamount = number_format($totalamount, 2);
echo "total Including Tax: $".$totalamount."<BR>\n";
?>

vincevincevince

7:27 am on Aug 25, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



echo "Items ordered: ".$totalqty."<BR>\n;
echo "Subtotal: ".$totalamount."<BR>\n;

Count the "... you open it before <BR>\n but don't close it again.

Solution:

echo "Items ordered: ".$totalqty."<BR>\n";
echo "Subtotal: ".$totalamount."<BR>\n";

jatar_k

11:45 am on Aug 25, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



and Welcome to WebmasterWorld DeadlyPersona