Skip to content

Instantly share code, notes, and snippets.

@rekby
Created January 17, 2018 19:00
Show Gist options
  • Save rekby/28f99321a8194bad1671ace9c5749734 to your computer and use it in GitHub Desktop.
Save rekby/28f99321a8194bad1671ace9c5749734 to your computer and use it in GitHub Desktop.
php log requests
<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$REKBY_DUMP_ARR = array();
$REKBY_DUMP_ARR['URI'] = $_SERVER['REQUEST_URI'];
$REKBY_DUMP_ARR['REQUEST'] = $_REQUEST;
$REKBY_DUMP_ARR['GET'] = $_GET;
$REKBY_DUMP_ARR['POST'] = $_POST;
$REKBY_DUMP_ARR['COOKIE'] = $_COOKIE;
$REKBY_DUMP_ARR['REMOTE_ADDR'] = $_SERVER['REMOTE_ADDR'];
file_put_contents("../php-log/".date('Y-m-d--H-i-s--').rand(100000,999999), print_r($REKBY_DUMP_ARR, true));
unset($REKBY_DUMP_ARR);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment