HTTP Connection Information Logging
This is to check if the connection information is correct for testing when using OpenAPI.
Method values, host, POST values upon connection.
[PHP]
<?
$log = $_SERVER['REQUEST_METHOD'].' '.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].'
n';
foreach($_SERVER as $k => $v)
{
if($k=='HTTP_HOST') continue;
if(substr($k, 0,5)!='HTTP_') continue;
$log .= '$k: $v'."
";
}
$log .= " ";
$post = array_map('urldecode', explode('&', file_get_contents('php://input')));
foreach($post as $v)
{
$log .= "$v
";
}
$log .= "--------------- ";
file_put_contents('log.txt', $log, FILE_APPEND | LOCK_EX);
?>
[/PHP]











Leave a Reply