"Invalid request"]); exit; } $rawData = file_get_contents("php://input"); $data = json_decode($rawData, true); if (!$data) { echo json_encode(["error" => "No data received"]); exit; } $googleScriptUrl = 'https://script.google.com/macros/s/AKfycbxr4mE-xftZscDgslutrQUNBFQhh-Qi5-Ni6QGNV6wDrHnzHpjEtq0CdGHEngbA8JVo/exec'; $options = [ 'http' => [ 'header' => "Content-type: application/json", 'method' => 'POST', 'content' => json_encode($data), ] ]; $context = stream_context_create($options); $result = file_get_contents($googleScriptUrl, false, $context); echo json_encode(["status" => "Data forwarded", "result" => $result]);