🚀 Hostinger Optimized
🖥️ Server: LiteSpeed
💻 System: Linux in-mum-web1643.main-hosting.eu 5.14.0-611.42.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 24 05:30:20 EDT 2026 x86_64
👤 User: u621169360 (621169360)
🐘 PHP: 8.2.30
🚫 Disabled: system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail

💻 Terminal

📁 /home/u621169360/domains/agriexpertt.com/public_html/wp-admin
$

📄 categories.php

📁 Path: /home/u621169360/domains/agriexpertt.com/public_html/mobile/Flutter/categories.php
📊 Size: 878 B
🔒 Perm: 0644
📝 MIME: text/x-php
<?php

// Enable CORS headers
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: GET, POST");
header("Access-Control-Allow-Headers: Content-Type");

require_once 'db.php';

// Query the database to get all active districts
$query = "SELECT * FROM question_cats WHERE status = 'Active'";
$stmt = $pdo->prepare($query);
$stmt->execute();

// Fetch all matching districts
$data = $stmt->fetchAll(PDO::FETCH_ASSOC);

if ($data) {
    // If districts are found
    $response = [
        'success' => true,
        'message' => 'Retrieved',
        'datas' => $data  // Return all districts in an array
    ];
} else {
    // No districts found
    $response = [
        'success' => false,
        'message' => 'No active districts found',
    ];
}

// Send the response as JSON
header('Content-Type: application/json');
echo json_encode($response);

?>
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨