HEX
Server: LiteSpeed
System: Linux srv147.niagahoster.com 4.18.0-553.30.1.lve.el8.x86_64 #1 SMP Tue Dec 3 01:21:19 UTC 2024 x86_64
User: u5264046 (1022)
PHP: 7.4.33
Disabled: symlink,shell_exec,exec,popen,system,dl,passthru,escapeshellarg,escapeshellcmd,show_source,pcntl_exec
Upload Files
File: /home/u5264046/public_html/abdhannan_codes/templates/index.php
<?php

// Include configuration (if needed)
require_once 'config.php';

// Include logic for fetching templates
require_once 'templates.php';

// Route requests based on URL path
$route = explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));

switch ($route[1]) {
    case 'templates':
        $templates = get_templates();  // Call your function to fetch templates
        header('Content-Type: application/json');
        echo json_encode($templates);
        break;
    default:
        header('HTTP/1.1 404 Not Found');
        echo '404 Not Found';
}