= $maxWebhooks) { $error = 'Maximum number of webhooks (' . $maxWebhooks . ') reached.'; } else { $key = bin2hex(random_bytes(8)); $webhook = [ 'key' => $key, 'created' => date('c'), 'requests' => [] ]; $data['webhooks'][] = $webhook; file_put_contents($dataPath, json_encode($data, JSON_PRETTY_PRINT), LOCK_EX); header('Location: ' . $_SERVER['REQUEST_URI']); exit; } } // Load webhooks $raw = file_get_contents($dataPath); $data = json_decode($raw, true); $webhooks = $data['webhooks']; ?>
| Key | Created | Requests | Webhook URL | Actions |
|---|---|---|---|---|
= htmlspecialchars($webhook['key']) ?> |
= htmlspecialchars(date('Y-m-d H:i:s', strtotime($webhook['created']))) ?> | = count($webhook['requests']) ?> |
= htmlspecialchars($baseUrl . '/webhook.php?key=' . $webhook['key']) ?>
|
View Requests |