OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
firebase
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/09/2025 11:18:49 AM
rwxr-xr-x
📄
app.js
1.07 KB
08/12/2024 10:32:50 AM
rw-r--r--
📄
composer.json
66 bytes
08/12/2024 10:32:50 AM
rw-r--r--
📄
composer.lock
93.17 KB
08/12/2024 10:32:50 AM
rw-r--r--
📁
config
-
08/12/2024 10:32:51 AM
rwxr-xr-x
📄
db.php
285 bytes
08/12/2024 10:32:50 AM
rw-r--r--
📄
debug.log
0 bytes
08/12/2024 10:32:50 AM
rw-r--r--
📄
firebase-messaging-sw.js
1.08 KB
08/12/2024 10:32:51 AM
rw-r--r--
📄
index.php
2.03 KB
08/12/2024 10:32:51 AM
rw-r--r--
📄
logo.png
49.4 KB
08/12/2024 10:32:51 AM
rw-r--r--
📄
save-token.php
773 bytes
08/12/2024 10:32:51 AM
rw-r--r--
📄
send-notification.php
1.5 KB
08/12/2024 10:32:51 AM
rw-r--r--
📁
vendor
-
08/12/2024 10:33:06 AM
rwxr-xr-x
Editing: save-token.php
Close
<?php // save-token.php // Database connection include 'db.php'; // Get the token from the POST request $data = json_decode(file_get_contents('php://input'), true); $token = $data['token'] ?? null; // Using null coalescing operator to handle undefined $data['token'] // Log the received token for debugging error_log("Received token: " . print_r($data, true)); // Check if token is not empty if (empty($token)) { echo "No token received."; exit; } // Save the token to the database $stmt = $conn->prepare("INSERT INTO fcm_tokens (token) VALUES (?)"); $stmt->bind_param("s", $token); if ($stmt->execute()) { echo "Token saved successfully."; } else { echo "Error: " . $stmt->error; } $stmt->close(); $conn->close(); ?>