rendered paste body<?php
require_once 'classes/blusql/blusql.php';
$blu = new blusql;
$file_query = "SELECT `filename` FROM `riot2_downloads` WHERE `id` = " . $_GET['id'];
$file_result = $blu->pull($file_query);
$dir = "/files/projects/";
$file = $dir . $file_result[0]['filename'];
header("Content-type: application/force-download");
header("Content-Transfer-Encoding: Binary");
header("Content-length: " . filesize($file));
header("Content-disposition: attachment; filename=\"" . basename($file) . "\"");
readfile("$file");
echo '<div style="background: #f0f; padding: 30px; width: 500px; margin: auto;">';
echo '<pre>';
print_r($file_result);
echo '</pre>';
echo '</div>';
?>