2
我最近使用www.acra.ch Exception Report library。連接Android acra lib異常報告到php
在acra網站上指出「你可以自己編碼!」 (經理),所以我想用一個PHP文件在數據庫中插入數據,但我找不到任何示例PHP腳本來獲取發佈的值,並繼續我的工作!
我最近使用www.acra.ch Exception Report library。連接Android acra lib異常報告到php
在acra網站上指出「你可以自己編碼!」 (經理),所以我想用一個PHP文件在數據庫中插入數據,但我找不到任何示例PHP腳本來獲取發佈的值,並繼續我的工作!
這是我使用的最簡單的腳本。它將所有的POST數據轉儲到由它發生的日期命名的文本文件:我約98.7%肯定這是他們在ACRA的幫助網站提供的PHP腳本
<?php
// Outputs all POST parameters to a text file. The file name is the date_time of the report reception
$fileName = date('Y-m-d_H-i-s').'.txt';
$file = fopen($fileName,'w') or die('Could not create report file: ' . $fileName);
foreach($_POST as $key => $value) {
$reportLine = $key." = ".$value."\n";
fwrite($file, $reportLine) or die ('Could not write to report file ' . $reportLine);
}
fclose($file);
?>
(不記得在哪裏我最初發現這一點)。
看看重要的東西:
foreach($_POST as $key => $value) {
$reportLine = $key." = ".$value."\n";
fwrite($file, $reportLine) or die ('Could not write to report file ' . $reportLine);
}
如果你想以某種方式映射到數據庫中,上述for-each循環是怎麼你就可以得到鍵值對。從那裏,你應該能夠確定你想要實際保存的內容。