OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
reader
/
creamapi
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/04/2025 08:32:49 AM
rwxr-xr-x
📄
api.php
1.35 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
db.php
355 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
fetch_data.php
3.59 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
generate_token.php
1.34 KB
05/19/2025 10:07:15 AM
rw-r--r--
📄
proxy_fetch_data.php
932 bytes
05/19/2025 10:07:15 AM
rw-r--r--
📄
zfetch_data.php
1.84 KB
05/19/2025 10:07:15 AM
rw-r--r--
Editing: api.php
Close
<?php // api.php - Fetch data from user_collection table using API token include 'db.php'; $token = $_GET['token']; // API token is provided via the GET parameter if ($token) { // Validate token $stmt = $mysqli->prepare("SELECT user_id FROM api_tokens WHERE api_token = ?"); $stmt->bind_param("s", $token); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { $row = $result->fetch_assoc(); $user_id = $row['user_id']; // Fetch user data from user_collection table $stmt = $mysqli->prepare("SELECT title, url, description, date_created FROM user_collection WHERE user_id = ?"); $stmt->bind_param("i", $user_id); $stmt->execute(); $content_result = $stmt->get_result(); $content = []; while ($row = $content_result->fetch_assoc()) { $content[] = $row; } // Return content in JSON format header('Content-Type: application/json'); echo json_encode($content); } else { // Invalid token header('Content-Type: application/json'); echo json_encode(["error" => "Invalid API token"]); } } else { // Token not provided header('Content-Type: application/json'); echo json_encode(["error" => "API token is required"]); } ?>