🚀 Hostinger Optimized
🖥️ Server: LiteSpeed
💻 System: Linux s20058.bom1.stableserver.net 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
👤 User: skhata (1324)
🐘 PHP: 8.4.20
🚫 Disabled: ✨ NONE

💻 Terminal

📁 /home/skhata/chandrasons.com/public
$

📄 download.php

📁 Path: /home/skhata/pimsnepal.com.np/download.php
📊 Size: 862 B
🔒 Perm: 0644
📝 MIME: text/x-php
<?php
/**
 * Handles a download click: increments the counter, then redirects to the
 * uploaded file (or back to the downloads page with a notice if no file
 * has been uploaded yet for that entry).
 */
require_once __DIR__ . '/includes/functions.php';

$id = (int) ($_GET['id'] ?? 0);
if ($id <= 0) {
    redirect('downloads.php');
}

$stmt = db()->prepare('SELECT * FROM downloads WHERE id = ? AND is_active = 1');
$stmt->execute([$id]);
$download = $stmt->fetch();

if (!$download) {
    redirect('downloads.php');
}

db()->prepare('UPDATE downloads SET download_count = download_count + 1 WHERE id = ?')->execute([$id]);

if (!empty($download['file_path'])) {
    redirect(assetUrl($download['file_path']));
}

flash('downloads_notice', 'That file has not been uploaded yet — please check back soon or contact us for a copy.');
redirect('downloads.php');
← Back📥 Raw✏️ Edit🔒 Chmod
✨ File Manager Magic ✨