I am looking to get a certain error, I am getting the T_VARIABLE error which means one of my variables is not declared. The path is correct I have checked and rechecked it. I will post my whole code. Note, I am a newb please understand that before judging me. I know there are simpler ways of doing some of the lines.
Bob's Auto Parts - Order Results!
Bob's Auto Parts
Order Results
<?php
echo "Order Processed at ";
echo date("H:i, jS F");
echo"
";
echo "Your order is as follows:";
echo"
";
define ("TIREPRICE", 100);
define ("OILPRICE", 10);
define ("SPARKPRICE", 4);
?>
<?php echo $_POST["tireqty"]; ?> tires<br>
<?php echo $_POST["oilqty"]; ?> oil<br>
<?php echo $_POST["sparkqty"]; ?> spark plugs<br>
<?php
$totalqty = $_POST["tireqty"] + $_POST["oilqty"] + $_POST["sparkqty"];
$totalamount= $_POST["tireqty"] * TIREPRICE
+ $_POST["oilqty"] * OILPRICE
+ $_POST["sparkqty"] * SPARKPRICE;
$totalamount = number_format($totalamount, 2);
echo"
\n";
echo "Items ordered: ".$totalqty."
\n";
echo "Subtotal: $".$totalamount."
\n";
$taxrate = 0.10; // this is the local tax rate
$totalamount = $totalamount * (1 + $taxrate);
$totalamount = number_format($totalamount, 2);
echo "Total including tax: $".$totalamount."
\n";
echo"
\n";
if ($totalqty == 0)
{
echo "";
echo "YOU DID NOT ORDER ANYTHING YOU FLAMING HOMO!
";
echo "";
}
echo $_POST["address"];
echo " , is the address that the order will be shipped to."
//open a file for appending.
$fp = fopen($_SERVER['DOCUMENT_ROOT']. 'Webdesign/wamp/www/orders.txt', 'ab'); // <----- Line 57
if (!$fp)
{
echo "
Your order could not be processed at this time. "
."Please try again later.
"
EXIT;
}
?>
this is the error that comes up.
( ! ) Parse error: syntax error, unexpected T_VARIABLE, expecting ‘,’ or ‘;’ in C:\Webdesign\wamp\www\hello.php on line 57