Skip to content

Instantly share code, notes, and snippets.

@jacksonfdam
Forked from KevinGaudin/report.php
Created August 11, 2013 15:03
Show Gist options
  • Select an option

  • Save jacksonfdam/6205273 to your computer and use it in GitHub Desktop.

Select an option

Save jacksonfdam/6205273 to your computer and use it in GitHub Desktop.
<?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);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment