mirror of
https://github.com/cytopia/devilbox.git
synced 2025-01-12 07:52:45 +00:00
11 lines
480 B
PHP
11 lines
480 B
PHP
<?php
|
|
$TABLE = $_GET["download"];
|
|
$fields = fields($TABLE);
|
|
header("Content-Type: application/octet-stream");
|
|
header("Content-Disposition: attachment; filename=" . friendly_url("$TABLE-" . implode("_", $_GET["where"])) . "." . friendly_url($_GET["field"]));
|
|
$select = array(idf_escape($_GET["field"]));
|
|
$result = $driver->select($TABLE, $select, array(where($_GET, $fields)), $select);
|
|
$row = ($result ? $result->fetch_row() : array());
|
|
echo $row[0];
|
|
exit; // don't output footer
|