![]() |
|
首页 │ Apache │ Linux│ Java│ MySQL│ 注册│帮助 | |||
相关问题
[PHP]
if($_GET[action]=="export")//导出
{
//标题
$text.=export_title($_GET[maxpage]);
$text.="日期,总流量,TCP,UDP,其它IP\n";
//
$sql=rawurldecode($_GET[sql]);
$sql=str_replace("\'","'",$sql);
$query=$DB->query($sql);
$count=$DB->num_rows($query);
if($count==0)$text.="\n".$config[nodata];
while($kind=$DB->fetch_array($query))
{
$text.=$kind[deviceid].",".$kind[deviceid].",".$kind[deviceid].",".$kind[deviceid].",".$kind[devicename]."\n";
}
$filename=$config[$_GET[name]].".csv";
$fileopen=fopen($config[temp].$filename,"w");
fwrite($fileopen,$text);
fclose($fileopen);
$filename=rawurlencode($filename);
header("location:export.php?action=download&filename=$filename");
}
[/PHP]
提问者:webajie 08-18 14:02
答复

