Skip to content

Instantly share code, notes, and snippets.

@jacksonfdam
Created January 21, 2017 17:32
Show Gist options
  • Save jacksonfdam/76540bb8f63a1d16a843763d2645ea68 to your computer and use it in GitHub Desktop.
Save jacksonfdam/76540bb8f63a1d16a843763d2645ea68 to your computer and use it in GitHub Desktop.
<?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