浏览器返回按钮单击时出错

时间:2017-10-23 11:20:42

标签: php forms codeigniter

我正在使用codeigniter框架,我正在做一个搜索页面。当我输入关键字并搜索该关键字时,将显示结果列表。从该列表中,我单击一个结果的详细信息,从该详细信息页面单击浏览后退按钮,显示错误页面

  

确认表格重新提交

     

此网页需要您之前输入的数据才能正确显示。您可以再次发送此数据,但通过这样做,您将重复此页面之前执行的任何操作。   按重新加载按钮重新提交加载页面所需的数据。

     

ERR_CACHE_MISS

这是我的控制器功能

public function search(){
        $data["page"] = "search_companies";
        $base_url .= HOST_URL."/search/companies";
        $uri_array = $this->uri->uri_to_assoc(3);
        if(isset($_POST) && count($_POST) != 0) {
        $keyword = $this->input->post("search_txt", TRUE);
        $_SESSION['keyword']=$keyword;
        }
        else{
        $keyword=$_SESSION['keyword'];
        }
        $user_id = $this->session->userdata("user_id");
        $data['user_id']=$user_id;
        $this->load->library('pagination');
        $offset    = (array_key_exists('offset',$uri_array) ? trim($uri_array["offset"]) : 0);
        $limit     = (!empty($paging) ? $paging : "30" );           
        $base_url .= "/offset";
        $limit1 =("6");
        $limit23 = ("6");           
        $total_records = $this->modelNameAlias->countSearchResults($keyword);
        $uri_segments  = $this->uri->total_segments();
        if($uri_segments==3){
        $uri_segments=4;
        }
        else{
        $uri_segments=$uri_segments;
        }       
        $config = user_side_paging($limit,$total_records, $base_url, $uri_segments);
        $this->pagination->initialize($config);
        $data['links'] = $this->pagination->create_links();
        $by         = "DESC";
        $sortWith  = "added_date";
        $data_list = $this->modelNameAlias->get_search_records($keyword,$limit, $offset, $sortWith, $by);
        $this->load->model("model_followers");
        $where_array["user_id"] = $user_id;
        $where_array["is_active"] = "Y";    
        $data["data_user123"] = $this->model_followers->get_all_records($where_array, $limit23, $offset, $sortWith, $by);
        $where_array1["target_id"] = $user_id;
        $where_array1["is_active"] = "Y";
        $data["data_user_myf"] = $this->model_followers->get_all_records($where_array1, $limit1, $offset, $sortWith, $by );    
        $data["data_list"]        = $data_list;
        $data["search_text"]      = $keyword;
        $data["display_records"]  = display_records($total_records, $offset, $limit);
        $data["total_records"]    = $total_records;
        $data['offset']           = $offset;
        $data["paging"]           = $limit;
        $this->load->view("template", $data);
    }

如何解决这个问题?

0 个答案:

没有答案