Anyone can teach me?
thanks
Moderator: General Moderators
Code: Select all
$reportName="report";
$filetype="csv";
$varInput="....whatever value u want to pass in..";
$ip = $_SERVER['SERVER_NAME'];
header("Content-type: application/octet-stream");
header("Pragma: public");
header("Content-disposition: attachment; filename=".$ip."_".$reportName."_".date("Ymd").".".$filetype);
header("Cache-Control: post-check=0, pre-check=0, max-age=0");
header("Expires: 0");
$current_datetime = date("F j, Y, g:i a");
...some function to call your report query
print "\n";
print $head."\n".$data;Code: Select all
$reportName="report";
$filetype="csv";
$varInput="....whatever value u want to pass in..";
$ip = $_SERVER['SERVER_NAME'];
header("Content-type: application/octet-stream");
header("Pragma: public");
header("Content-disposition: attachment; filename=".$ip."_".$reportName."_".date("Ymd").".".$filetype);
header("Cache-Control: post-check=0, pre-check=0, max-age=0");
header("Expires: 0");
$current_datetime = date("F j, Y, g:i a");
$this->get_query(...variable to pass in...);
print $head."\n".$data;
function get_query(...variable to pass in....)
{
....sql scripts goes here
}