<?php
require_once __DIR__ . '/inc/bootstrap.php'; require_login('admin');
$f=RESULTS_PATH; if(!file_exists($f)){ header('HTTP/1.1 404 Not Found'); echo 'results.csv not found.'; exit; }
header('Content-Type: text/csv'); header('Content-Disposition: attachment; filename="results.csv"'); readfile($f);