Loading editor... Echo pack ("Ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0 );
Return;
}
Function xlseof (){
Echo pack ("SS", 0x0a, 0x00 );
Return;
}
Function xlswritenumber ($ row, $ Col, $ value ){
Echo pack ("sssss", 0x203, 14, $ row, $ Col, 0x0 );
Echo pack ("D", $ value );
Return;
}
Function xlswritelabel ($ row, $ Col, $ value ){
$ L = strlen ($ value );
Echo pack ("Ssssss", 0x204, 8 + $ L, $ row, $ Col, 0x0, $ L );
Echo $ value;
Return;
}
Include "enable database files ";
$ SQL = "select * from table ";
$ Query = mysql_query ($ SQL );
// File Header
Header ("Pragma: Public ");
Header ("expires: 0 ");
Header ("cache-control: Must-revalidate, post-check = 0, pre-check = 0 ");
Header ("Content-Type: Application/force-download ");
Header ("Content-Type: Application/octet-stream ");
Header ("Content-Type: Application/download ");;
Header ("content-Disposition: attachment?filename=456.xls ");
Header ("content-transfer-encoding: Binary ");
// Add data to the table
Xlsbof ();
Xlswritelabel (0, 0, "column name ");
Xlswritelabel (0, 1, "column name ");
Xlswritelabel (0, 2, "column name ");
Xlswritelabel (0, 3, "column name ");
Xlswritelabel (0, 4, "column name ");
$ Xlsrow = 1;
While ($ array = mysql_fetch_array ($ query )){
++ $ I;
Xlswritenumber ($ xlsrow, 0, "$ I ");
Xlswritenumber ($ xlsrow, 0, "$ array [0]");
Xlswritelabel ($ xlsrow, 1, "$ array [1]");
Xlswritelabel ($ xlsrow, 2, "$ array [2]");
Xlswritelabel ($ xlsrow, 3, "$ array [3]");
Xlswritelabel ($ xlsrow, 4, "$ array [4]");
$ Xlsrow ++;
}
Xlseof ();
Exit ();
?>