My code is:
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");
I want to redirect after download to index.php
but it is redirect before download.
I write a code header("Location:index.php");
at end of the file but it is redirect before
download the file.
Any solution for that?