$type, 'title' => $title, 'message' => $message ]; $ch = curl_init(); curl_setopt_array($ch, [ CURLOPT_URL => $config['push_url'], CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . $config['api_key'], 'Content-Type: application/json' ], CURLOPT_POSTFIELDS => json_encode($payload), CURLOPT_TIMEOUT => 15 ]); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); if (curl_errno($ch)) { $error = curl_error($ch); curl_close($ch); header( 'Location: index.php?status=error&message=' . urlencode('cURL Fehler: ' . $error) ); exit; } curl_close($ch); if ($httpCode >= 200 && $httpCode < 300) { header( 'Location: index.php?status=success&message=' . urlencode('Push Notification erfolgreich versendet.') ); exit; } header( 'Location: index.php?status=error&message=' . urlencode( 'Server antwortete mit HTTP ' . $httpCode . ': ' . $response ) ); exit;