-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexportExcel.php
More file actions
30 lines (29 loc) · 956 Bytes
/
exportExcel.php
File metadata and controls
30 lines (29 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
if ( isset($_POST["format"],$_POST["content"]))
{
if ($_POST["format"] == 'xls')
{
header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; charset=utf-8");
header("Content-Disposition: attachment; filename=report.xls"); //File name extension was wrong
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
echo str_replace("<br />", " ", $_POST["content"]);
exit;
}
if ($_POST["format"]=='csv')
{
header("Content-type: text/csv");
header("Content-Disposition: attachment; filename=report.csv");
header("Pragma: no-cache");
header("Expires: 0");
echo str_replace("<br />", " ", $_POST["content"]);
}
else{
echo "ne por�an fomrat za export";
}
}
else {
echo "Post za paramter nije poslan";
}
?>