Skip to content

Instantly share code, notes, and snippets.

@h4sh5
Created December 27, 2022 01:23
Show Gist options
  • Select an option

  • Save h4sh5/8fead1ca95fba23261e28d7faad0d14f to your computer and use it in GitHub Desktop.

Select an option

Save h4sh5/8fead1ca95fba23261e28d7faad0d14f to your computer and use it in GitHub Desktop.
log request data
<?php
// a script that just logs stuff, from something like echo 123 | curl -d@- url
$entityBody = file_get_contents('php://input');
file_put_contents('just_the_log.txt', "\n---" . $_SERVER["REMOTE_ADDR"] . "|" . $_SERVER["HTTP_X_FORWARDED_FOR"] . "|" . $entityBody, FILE_APPEND | LOCK_EX);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment