echo "<p>Total of order is $".$totalamount."</p>";
echo "<p>Address to ship to is ".$address."</p>";
$outputstring = $date. "\t".$tireqty." tires \t".$oilqty." oil\t".$sparkqty." spark plugs\t\$".$totalamount."\t". $address."\n";
// open file for appending
@ $fp = fopen("$DOCUMENT_ROOT/../test/orders.txt", 'ab');
if (!$fp) {
echo "<p><strong> Your order could not be processed at this time. Please try again later.</strong></p></body></html>";
exit;
}
flock($fp, LOCK_EX);
fwrite($fp, $outputstring, strlen($outputstring));
flock($fp, LOCK_UN);
fclose($fp);
echo "<p>Order written.</p>";
?>