Strange, to add data to Notepad, with \ t partition, the results into a notepad, the length of each tab key is inconsistent?
See figure
Reply to discussion (solution)
Wood, is anyone answering?
The source code is as follows, is two files, one commits the data, one processes the data.
Order Results
Bob ' s Auto Parts
Order Results
echo "
Order precessed at ";
echo Date (' H:i,js F ');
echo "
";
?>
$totalqty = 0;
Print_r ($_post);
echo "
";
$tireqty = $_post[' Tireqty ');
$oilqty = $_post[' Oilqty ');
$sparkqty = $_post[' Sparkqty ');
$address = $_post[' address '];
$DOCUMENT _root = $_server[' document_root ');
$totalqty = $tireqty + $oilqty + $sparkqty;
$date = Date (' H:i,js F Y ');
echo "Item Ordered: $totalqty
";
if ($totalqty ==0) {
echo "You do not have order anything on the Bob ' s site!";
} else {
if ($tireqty >0) {
echo $tireqty. " Tireqty
";
}
if ($oilqty >0) {
echo $oilqty. " Oilqty
";
}
if ($sparkqty >0) {
echo $sparkqty. " Sparkqty
";
}
}
$totalamount = 0.00;
Define (' Tireprice ', 100);
Define (' Oliprice ', 10);
Define (' Sparkprice ', 4);
$totalamount = $tireqty *tireprice
+ $oilqty *oliprice
+ $sparkqty *sparkprice;
$totalamount = Number_format ($totalamount, 2, '. ', ');
echo "
TotalAmount is $ ". $totalamount."
";
$tax _rate = 0.1;
$totalamount = $totalamount * (1+ $tax _rate);
echo "total including tax:$". $totalamount. "
";
$putstrings = $date. " \ t ". $tireqty." Tires\t ". $oilqty." Oil\t ". $sparkqty." Spark plugs\t "." TotalAmount $ ". $totalamount." \ t "." Address ". $address." \ r \ n ";
Print_r ($DOCUMENT _root);
@ $fp = fopen ("$DOCUMENT _root/. /orders/order.txt ", ' ab ');
Flock ($FP, LOCK_EX);
if (! $fp) {
echo "
Your order is isn't processed at this time.
Please try again later.
";
Exit
}
Fwrite ($fp, $putstrings, strlen ($putstrings));
Flock ($FP, lock_un);
Fclose ($FP);
echo "Order written!";
?>
This is the question of Notepad, you can use the editor such as notepad++ to open the text file just fine.
This is related to how many spaces tab equals. Notepad seems to be 8.