Created
May 19, 2017 05:40
-
-
Save ygerasimov/9cc1da08ca898a8b10980b7f25e42f62 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('LOGFILE', '/tmp/callback.log'); | |
if ($_SERVER['REQUEST_METHOD'] == 'GET') { | |
if (file_exists(LOGFILE)) { | |
print file_get_contents(LOGFILE); | |
} | |
else { | |
print 'Log file does not exist.'; | |
} | |
} | |
if ($_SERVER['REQUEST_METHOD'] == 'POST') { | |
$body = file_get_contents('php://input'); | |
file_put_contents(LOGFILE, $body); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment