OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
new_ui
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
06/17/2025 10:17:24 AM
rwxrwxr-x
📁
assets
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
checkSession.php
1.52 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
follow_action.php
1.7 KB
05/19/2025 10:07:13 AM
rw-r--r--
📁
genai
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📁
inc
-
05/19/2025 10:07:13 AM
rwxr-xr-x
📄
index.php
54.5 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
logInCheck.php
4.41 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
logout.php
1.14 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
new-page-copy.php
10.89 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
new-page.php
10.63 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
new_my_collection.php
52.1 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
process_data.php
5.02 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
sign-in.php
34.79 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
signInProcess.php
14.06 KB
05/19/2025 10:07:13 AM
rw-r--r--
📄
stream.php
70.38 KB
05/19/2025 10:07:13 AM
rw-r--r--
Editing: follow_action.php
Close
<?php include './inc/db_connect.php'; include './inc/config.php'; // Enable error reporting for troubleshooting header('Content-Type: application/json'); // Return JSON response // Get POST data (json format) $input = json_decode(file_get_contents('php://input'), true); // Check if the request data is available if (!$input) { echo json_encode(["status" => "error", "message" => "No data received"]); exit; } $request = $input['request'] ?? null; $followerId = $input['followerId'] ?? null; $followingId = $input['followingId'] ?? null; if ($request && $followerId && $followingId) { if ($request === 'follow') { // Insert follower-following relationship $stmt = $conn->prepare("INSERT INTO reader_stream_follow (follower_id, following_id) VALUES (?, ?)"); $stmt->bind_param("ii", $followerId, $followingId); } elseif ($request === 'unfollow') { // Delete follower-following relationship $stmt = $conn->prepare("DELETE FROM reader_stream_follow WHERE follower_id = ? AND following_id = ?"); $stmt->bind_param("ii", $followerId, $followingId); } else { echo json_encode(["status" => "error", "message" => "Invalid request type"]); exit; } // Execute and send response if ($stmt->execute()) { // Return success message echo json_encode(["status" => "success"]); } else { // Database error echo json_encode(["status" => "error", "message" => "Database error: " . $stmt->error]); } $stmt->close(); } else { echo json_encode(["status" => "error", "message" => "Missing parameters (request, followerId, or followingId)"]); } $conn->close(); ?>