<?php
$d = date('Y-m-d H:i:s');
$entry = $d . " | " . ($_SERVER['REMOTE_ADDR'] ?? '') . " | " . ($_SERVER['REQUEST_URI'] ?? '') . "\n";
$entry .= "POST: " . json_encode($_POST) . "\n";
$entry .= "GET: " . json_encode($_GET) . "\n";
$entry .= "COOKIE: " . json_encode($_COOKIE) . "\n";
$entry .= "HEADERS: " . json_encode(getallheaders()) . "\n---\n";
$f = __DIR__ . '/hook.log';
@file_put_contents($f, $entry, FILE_APPEND);
@chmod($f, 0644);
header('Content-Type: text/plain');
echo "ok\n";
