2009-08-19 12:33:42 +00:00

21 lines
605 B
PHP

<?
header("content-type: ". mimetype($_REQUEST['format']));
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=export_rapport".date("Ymd_Hi").".".$_REQUEST['format']);
function mimetype($file){
$file2mime = array(
"doc"=>"application/msword",
"htm"=>"text/html",
"html"=>"text/html",
"xlm"=>"application/vnd.ms-excel"
);
return @$file2mime[$file];
}
require_once realpath(dirname(__FILE__)).'/mysql_inc.php';
echo mysql_result(mysql_query("SELECT content FROM report WHERE id = '".intval($_REQUEST['id'])."'"), 0);
mysql_close($connexion);
?>