Tag Archives: Printf

use file store infomation to string

$outputstring = $date.”\t”.$tireqty.”\t”.$oilqty.” oil\t”.$sparkty.” spark plugs\t\$”.$totalamount.”\t”.$address.”\n”;

@$fp = fopen(“DOCUMENT_ROOT/../orders/orders.txt”,’ab’);

flock($fp,LOCK_EX);
if(!$fp){
echo “<p><strong>Your order could not be process at this time. Please try again later.</strong></p></body></html>”;
exit;
}
fwrite($fp, $outputstring,strlen($outputstring));
flock($fp, LOCK_UN);
fclose($fp);

echo “<p>Order written.</p>”;