From 917f9f6602659fb5d0a859cb8035f808f7a0ecf5 Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Tue, 26 Nov 2013 23:16:04 +0000 Subject: Added the ability for a user to export search results to a CSV file. --- export.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 export.php (limited to 'export.php') diff --git a/export.php b/export.php new file mode 100644 index 0000000..2ceca89 --- /dev/null +++ b/export.php @@ -0,0 +1,24 @@ +prepare($sql); +if ( $st->execute() ) { + readfile($filename); +} else { + $errors = $st->errorInfo(); + print_r($errors); +} + +unlink($filename); + +?> -- cgit v1.2.3 From 45d871d823bb8002e749e32d75eb1b2fd43353d5 Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Fri, 28 Mar 2014 11:38:03 +0000 Subject: Fixed path for CSV export file --- export.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'export.php') diff --git a/export.php b/export.php index 2ceca89..b9cdfac 100644 --- a/export.php +++ b/export.php @@ -2,7 +2,7 @@ $dbh = new PDO('mysql:host=localhost;dbname=mdcc', 'mdcc', 'Mdcc.'); -$filename = '/var/www/mdcc/csv_exports/mdcc_export.csv'; +$filename = '/var/www/dighelaw.com/www/mdcc/csv_exports/mdcc_export.csv'; header('Content-Type: text/csv'); header("Content-Disposition: attachment; filename={$filename}"); -- cgit v1.2.3