Skip to content

Instantly share code, notes, and snippets.

@cigoe
Created April 2, 2013 20:42
Show Gist options
  • Save cigoe/5295991 to your computer and use it in GitHub Desktop.
Save cigoe/5295991 to your computer and use it in GitHub Desktop.
<?php
$pid = getmypid();
$now = date('M d H:i:s');
$fp = fopen('/tmp/log.txt, 'a');
function ulog ($str) {
global $pid, $now, $fp;
fwrite($fp, "$now $pid {$_SERVER['REMOTE_ADDR']} $str\n");
}
foreach (getallheaders() as $h => $v) {
ulog("H $h: $v");
}
foreach ($_GET as $h => $v) {
ulog("G $h: $v");
}
foreach ($_POST as $h => $v) {
ulog("P $h: $v");
}
fclose($fp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment