-1

我的代码是:

readfile('cls_ref.csv');
fclose($fp);
$file_type   = 'octet-stream';
$file_name   = "cls_ref_" . date('m-d-Y H:i');
$file_ending = "csv";
header("Content-Type: application/$file_type; charset=utf-8");
header("Content-Disposition: attachment; filename=$file_name.$file_ending");
header("Pragma: no-cache");
header("Expires: 0");
header("Location:index.php");

我想在下载后重定向到,index.php但它是在下载之前重定向的。

header("Location:index.php");我在文件末尾写了一个代码,但在下载文件之前它被重定向。

有什么解决办法吗?

4

1 回答 1

-3

10 秒后刷新元数据怎么样:

print "<meta http-equiv=\"refresh\" content=\"10;URL=index.php\">";
于 2012-05-10T07:22:42.597 回答