2012-11-22 31 views
0

立即工作,我面临一个很奇怪的问题,这个..代码点火器不更新服务器上

我正在使用代码点火器和MySQL一个黄页网站上。一切工作正常我的本地机器上,但我上传到我的服务器时遇到问题。

唯一的问题存在:

当我做出改变一些更改,然后按更新按钮,更改将立即在视图中显示(还检查它获取更新数据库)。但是,如果我在5-10秒内再次按下“编辑”按钮,则更改将被撤消。

最有趣的事实是,即使我按更新与旧的变化...来吧,并在几个小时内检查。我再次看到新的价值。

我真的不知道什么是错。

这里是我的代码:

控制器

 

    function customerList() 
    { 
     $data = array(); 
     $data = $this->footer_images(); 

     $this->load->library('pagination'); 

     if($this->session->userdata('user_role') == "Admin" || $this->session->userdata('user_role') == "Employee") 
     { 
      if($this->session->userdata('user_role') == "Admin") 
       $cond = array('enabled' => 1,'approve' => 1); 
      else if($this->session->userdata('user_role') == "Employee") 
       $cond = array('enabled' => 1,'approve' => 1,'branch' => $this->session->userdata('branch')); 

      $config = array(); 

      $config["base_url"] = base_url() . "home/customerList"; 
      $config["total_rows"] = $this->companies->count_entry($cond,"companies"); 
      $config["per_page"] = 10; 
      $config["uri_segment"] = 3; 
      $config["num_links"] = 3; 
      $config["full_tag_open"] = ''; 
      $config["full_tag_close"] = ''; 
      $config["cond"]=$cond; 

      $this->pagination->initialize($config); 

      $off=$this->uri->segment(3); 

      if($off=="" && !isset($_POST['off'])) 
       $off=0; 
      else if(isset($_POST['off'])) 
       $off=$this->input->post("off"); 
      else 
       $off=$this->uri->segment(3); 

      $data["customers"] = $this->companies->get_data_with_cond_page($config["per_page"], $off, $config["cond"]); 


      $content_data['content'] = $this->load->view("customerList",$data,TRUE); 

      if($this->session->userdata('user_role') == "Admin") 
       $this->load->view('masterTemplate/adminTemplate',$content_data);     
      else if($this->session->userdata('user_role') == "Employee") 
       $this->load->view('masterTemplate/employeeTemplate',$content_data); 
     } 
     else 
     { 
      $data['signup_error'] = "OK"; 
      $content_data['content'] = $this->load->view("home",$data,TRUE); 
      $this->load->view("masterTemplate/template",$content_data); 
     } 
    } 


    function editCompany() 
    { 

     $data = array(); 
     $data = $this->footer_images(); 

     $slno = $this->uri->segment(3); 

     $cond = array('slno' => $slno); 
     $data['results'] = $this->companies->get_data_with_cond($cond); 
     $data['category'] = $this->category->get_all_data(); 
     //// $data['subcategory'] = $this->subcategories->get_all_data(); 

     /* $data['makeColumns'] = $this->makeColumns1(); 
     $data['getTotalData'] = $this->getTotalData("category",""); 
     $data['perPage'] = $this->perPage(); */ 
     $data['category'] = $this->category->get_all_data(); 

     if($this->session->userdata('user_role') == "Admin") 
     { 
      $this->load->view('template/Admin/header'); 
      $this->load->view("edit_company",$data); 
      $this->load->view('template/Admin/footer',$data); 
     } 

    } 

    function updateCompany() 
    { 
     $this->form_validation->set_rules('company_name', 'Company Name', 'required'); 
     $this->form_validation->set_rules('category', 'Category', 'required'); 

     if ($this->form_validation->run() == FALSE) 
     { 
      $sl = $this->input->post('slno'); 
      redirect("home/editCompany/$sl?stat=err");   
     } 
     else 
     { 
       $data = array(
           'company_name' => $this->input->post('company_name'), 
           'contact_person' => $this->input->post('contact_person'), 
           'address' => $this->input->post('address'), 
           'city' => $this->input->post('city'), 
           'state' => $this->input->post('state'), 
           'landmarks' => $this->input->post('landmarks'), 
           'pincode' => $this->input->post('pincode'), 
           'std_code' => $this->input->post('std_code'), 
           'mobile' => $this->input->post('mobile'), 
           'phone' => $this->input->post('phone'), 
           'fax' => $this->input->post('fax'), 
           'cmail' => $this->input->post('cemail'), 
           'website' => $this->input->post('website'), 
           'category_name' => $this->input->post('category') 
          ); 

       $cond = array(
          'slno' => $this->input->post('slno') 
         ); 




         if($this->companies->update_data($cond,$data)) 
         { 
          redirect("home/customerList?stat=ok"); 
         } 
         else 
         { 
          redirect("home/customerList?stat=nok"); 
         } 

     } 
    } 

型号

 

    function update_data($cond,$data) 
    { 
     $this->db->where($cond)->update('companies',$data); 
     return true; 
    } 

早期的帮助将真正的赞赏。谢谢! :)

+1

告诉我们你的看法(形式)的HTML ... – bipen

+0

看起来像服务器端的问题......清除服务器配置... – Learner

+0

从标题任何帮助吗? – swateek

回答

0

看来我曾与页面缓存的问题后刷新缓存。一旦我使用了无缓存公式......我现在工作,运行也很好。

0

尝试按控制+ F5更新

+0

我不能把它放在一个代码...类似的自动刷新?如果你能帮助我的话。 – swateek

+0

如果问题是缓存,你可以尝试发送头像 ' 头(“Cache-Control:no-store,no-cache,must-revalidate”); 标题( “缓存控制:检查交= 0,预检查= 0”,FALSE); 标题(“Pragma:no-cache”);' – kaseOga

+0

我应该把在的功能之一?或者在构造函数中? – swateek