LittleDemon WebShell


Linux in-mum-web1499.main-hosting.eu 5.14.0-503.40.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Mon May 5 06:06:04 EDT 2025 x86_64
Path : /home/u901718425/domains/task.urbanpillar.in/public_html/
File Upload :
Command :
Current File : /home/u901718425/domains/task.urbanpillar.in/public_html/fetch_task.php

<?php
require_once "db.php";

if (!isset($_SESSION['user_id'])) {
    http_response_code(403);
    echo json_encode([]);
    exit;
}

$date = $_GET['date'] ?? date('j');

$stmt = $conn->prepare("SELECT task FROM tasks WHERE user_id = ? AND DAY(created_at) = ?");
$stmt->bind_param("ii", $_SESSION['user_id'], $date);
$stmt->execute();

$result = $stmt->get_result();
$rows = [];
while ($row = $result->fetch_assoc()) {
    $rows[] = $row['task'];
}

echo json_encode($rows);
$stmt->close();
$conn->close();

LittleDemon - FACEBOOK
[ KELUAR ]