Hi coders ,
i've written some line of code for save a query output into a file attachmate :
if ($action=="export_uar") {
header("Content-disposition: attachment;filename=report.txt");
header("Content-type: application/octet-stream");
header("Pragma: no-cache");
header("Expires: 0");
$report_db=$DB_site->query("SELECT a.userid, a.username, a.joindate, a.lastvisit, a.lastpost, b.userid, b.field1, b.field8, b.field10, b.field11, b.field12 from user a,userfield b where a.userid=b.userid ");
while ($newarray=$DB_site->fetch_array($report_db))
//echo $newarray['userid'],$newarray['username'],"<br />\n";
print ("userid : $newarray[userid] - username : $newarray[username]\n");
}
It's work but not correctly fine , in the file saved the script add a html contens not wanted at the header and at the bottom :
<html><head>
<meta content="text/html; charset=windows-1252" http-equiv="Content-Type">
<meta http-equiv="MSThemeCompatible" content="Yes">
<link rel="stylesheet" href="../cp.css">
</head>
<body leftmargin="10" topmargin="10" marginwidth="10" marginheight="10">
userid : 645 - username : cow
userid : 639 - username : sgamo
userid : 643 - username : stargate75
userid : 584 - username : Aquilotto
userid : 585 - username : mikelin17
userid : 635 - username : Morph
userid : 632 - username : zeroccol
userid : 947 - username : Rtano
</BODY></HTML>
.. I need only this in the output :
userid : 645 - username : cow
userid : 639 - username : sgamo
userid : 643 - username : stargate75
userid : 584 - username : Aquilotto
userid : 585 - username : mikelin17
userid : 635 - username : Morph
userid : 632 - username : zeroccol
userid : 947 - username : Rtano
How I can obtain it ?
Please help me know !
Best regards.