adebbagh e8340814d1
2009-08-11 15:38:30 +00:00

21 lines
610 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];
}
include($_SERVER['DOCUMENT_ROOT']."/mysql_inc.php");
echo mysql_result(mysql_query("SELECT content FROM report WHERE id = '".intval($_REQUEST['id'])."'"), 0);
mysql_close($connexion);
?>