Skip to content

Commit

Permalink
Moved headers to before sql query to encapsulate errors in exported f…
Browse files Browse the repository at this point in the history
…ile.

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/trunk/unstable@721 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
jcleeland committed Oct 15, 2003
1 parent 9d2f6ad commit 3d46589
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions admin/dumpgroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,14 @@ function BuildOutput($Query)
return $Output;
}

//header("Content-Type: application/msword"); //EXPORT INTO MSWORD
header("Content-Disposition: attachment; filename=$fn");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// always modified
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");

//0: Groups Table
$gquery = "SELECT * FROM {$dbprefix}groups WHERE gid=$gid";
$gdump = BuildOutput($gquery);
Expand All @@ -124,13 +132,7 @@ function BuildOutput($Query)

$fn = "group_$gid.sql";

//header("Content-Type: application/msword"); //EXPORT INTO MSWORD
header("Content-Disposition: attachment; filename=$fn");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
// always modified
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
// HTTP/1.0
echo "#<pre>\n";
echo $dumphead, $gdump, $qdump, $adump, $cdump, $lsdump, $ldump;
echo "#</pre>\n";
Expand Down

0 comments on commit 3d46589

Please sign in to comment.