Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
318 views
in Technique[技术] by (71.8m points)

excel - This site can’t be reached in Codeignier

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...