After file download code I am getting the error at XAMPP
This site can’t be reachedThe webpage at http://localhost/aiken/index.php/admin/view_download might be temporarily down or it may have moved permanently to a new web address.
ERR_INVALID_RESPONSE
function view_download()
{
if(isset($_POST['submit']))
{
$start_date = date("Y-m-d", strtotime($this->input->post('start_date')));
$end_date = date("Y-m-d", strtotime($this->input->post('end_date')));
$auditor = $this->input->post('auditor_name');
$model = $this->input->post('model');
$processor = $this->input->post('processor');
$grade = $this->input->post('grade');
$this->load->model('admin_crud');
$data['data'] = $this->admin_crud->search_dynamic($start_date, $end_date, $auditor, $model, $processor, $grade);
//export data in CSV File
// file name
$filename = 'Search_'.date('Ymd').'.csv';
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Type: application/csv; ");
// get data
$usersData = $this->Crud_model->search_dynamic();
// file creation
$file = fopen('php://output','w');
$header = array(
'Gulf_ID', 'AssetTag', 'SerialNumber', 'PartNumber', 'Manufacturer', 'Model', 'BoardTest', 'Processor',
'ProcGen', 'ProcSpeed', 'RAM', 'Storage1Size', 'Storage1Type', 'StorageSmart', 'StorageHealth', 'Optical', 'Webcam', 'LAN',
'WIFI', 'Keyboard', 'FingerPrint', 'TrackPoint', 'Keyb.BackLight', 'BatteryTest', 'BatteryHealth', 'GRADE', 'COA', 'VideoCard',
'VideoCard2', 'VideoMemory', 'Resolution', 'TouchScreenStatus', 'MADEIN', 'ObservNotes', 'Expanded Codes 1st Audit',
'Expanded Codes 2nd Audit', '1st Audit Date', '2nd Audit Date', '1st Audit User', '2nd Audit User', 'Location', 'LaptopColour',
'HwID', 'LANMACAdr', 'UnitID'
);
fputcsv($file, $header);
foreach ($usersData as $key=>$line){
fputcsv($file,$line);
}
fclose($file);
$data['title'] = 'Dynamic Search';
$data['render'] = 'list_aiken';
$this->load->view('layouts/layout', $data);
}
else
{
redirect(base_url() . 'index.php/admin/search_dynamic');
}
}
question from:
https://stackoverflow.com/questions/65641095/this-site-can-t-be-reached-in-codeignier