Created
January 21, 2017 17:32
-
-
Save jacksonfdam/76540bb8f63a1d16a843763d2645ea68 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 | |
function curl_get_contents($url){ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
$data = curl_exec($ch); | |
curl_close($ch); | |
return $data; | |
} | |
function logIt($data) { | |
error_log(PHP_EOL."User: ".$_SERVER['REMOTE_ADDR'].' - '.date("F j, Y, g:i a").PHP_EOL.print_r($data,true), 3, $_SERVER['DOCUMENT_ROOT']."/data.log"); | |
} | |
logIt( $rawData = file_get_contents("php://input")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment