Skip to content

Instantly share code, notes, and snippets.

@CezaryDanielNowak
Created August 17, 2022 13:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CezaryDanielNowak/93f044db14aa6ea352fecd0ff9a9e00f to your computer and use it in GitHub Desktop.
Save CezaryDanielNowak/93f044db14aa6ea352fecd0ff9a9e00f to your computer and use it in GitHub Desktop.
<?php
/*
Place this file in writable directory. Each incoming request will be saved as a file.
Sample file name:
callback_POST_08-17-2022 13.42.05.780400.txt
*/
$now = DateTime::createFromFormat('U.u', microtime(true));
$file_name = 'callback_' . $_SERVER['REQUEST_METHOD'] . '_' . $now->format("m-d-Y H.i.s.u").'.txt';
$myfile = fopen($file_name, "w") or die("Unable to open file!");
fwrite($myfile, "GET:" . json_encode($_GET));
fwrite($myfile, "\nPOST:" . file_get_contents('php://input'));
fclose($myfile);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment