-
Notifications
You must be signed in to change notification settings - Fork 1
/
DiversitreeDownload.php
executable file
·43 lines (34 loc) · 1.05 KB
/
DiversitreeDownload.php
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
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
/*
AmerifluxData.php
by Hans Vasquez
Designed for use with SSWAP.
Started: 4/25/12
This Release: 5/2/12
*/
// DEBUG MODE.
ini_set('display_errors', 1);
//include_once("../includes/db_access/db_connect.php");
//include_once("includes/incPGSQL.php");
include_once("../../dev/includes/db_access/db_connect_sswap.php");
function scrub($data)
{
$str = preg_replace("/'/","&apos",$data);
return $str;
}
if(isset($_GET['tid'])) { // boolean pretty print option
$escapedTids = pg_escape_string(trim($_GET['tid']));
$tidarray = explode(',', $escapedTids);
// Prepare for download.
header("Cache-control: private");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Description: File Transfer");
header("Content-Type: application/octet-stream");
//header("Content-Type: application/msexcel; charset=ansi");
header("Content-disposition: attachment; filename=\"diversitree_bulk_upload_inputfile.csv\"");
header("Expires: 0");
foreach($tidarray as $j => $value) {
print "$value\n";
}
}
?>