an odd error...
Posted: Tue Jun 27, 2006 9:04 pm
I recieve this error when trying to indirectly manipulate input recieved through a form.
My code is as follows:
I've really have no idea as to what I'm supposed to fix - I can't spot the error.
Code: Select all
Parse error: parse error, unexpected T_DNUMBER in /home/mabufo/www/action.php on line 54Code: Select all
<?php
/* This scripts interprets, and builds upon,
the information entered into the form that is
found on the index.php page. */
//changes medium variable names to small names.
$tireqty = $_POST['tireqty'];
$oilqty = $_POST['oilqty'];
$sparkqty = $_POST['sparkqty'];
echo 'You have ordered: <br />';
//outputs form values
echo "$tireqty Tires <br />";
echo "$oilqty Oil Cans <br />";
echo "$sparkqty Spark Plugs <br />";
//tallies up the total amount of items
$totalqty = 0;
$totalqty = $tireqty + $oilqty + $sparkqty;
echo "Items ordered: $totalqty";
$totalamount = 0.00;
//needed constants
define('TIREPRICE', 100);
define('OILPRICE', 10);
define('SPARKPRICE', 4);
//tallies up total cost
$totalamount = $tireqty * TIREPRICE
+ $oilqty * OILPRICE
+ $sparkqty * SPARKPRICE;
/* this statement outputs the cost, without tax
The number_format() function is a php math
command that sets decimal places on the number
passed to the function */
echo 'Subtotal: $'.number_format($totalamount,2).'<br />';
//calculates the cost - with tax.
$taxrate 0.09;
$totalamount = $totalamount * (1 + $taxrate);
echo 'Total including tax: $'.number_format($totalamount,2).'<br />';
?>