doutangshuan6473 2019-02-28 12:36
浏览 60

在Codeigniter中提交或更新任何内容后不显示更新的数据

I have recently transferred my website to another server. Everything is working properly except one thing. When i submit or update any data on my website it is not showing the updated data. It's always showing old data no matter how many times i resubmitted or update my data. IT ONLY SHOWS UPDATED DATA WHEN I CLICK ON THE RELOAD BUTTON ON MY BROWSER.

Note: It's perfectly working successful on my database. My old website is working smoothly. I am using redirect() refresh on every controller

this is my config.php

<?php  if(!defined('BASEPATH'))exit('No direct script access allowed');

$config['base_url']='https://eshaplasticbd.net/';

$config['index_page']='';

$config['uri_protocol']='AUTO';

$config['url_suffix']='';



$config['language']='english';        $config['charset']='UTF-8';    
   $config['enable_hooks']=FALSE;          
   $config['subclass_prefix']='MY_';          
   $config['permitted_uri_chars']='a-z 0-9~%.:_\-';          
   $config['allow_get_array']=TRUE;          
   $config['enable_query_strings']=FALSE;      
   $config['controller_trigger']='c';      
   $config['function_trigger']='m';    $config['directory_trigger']='d';
   $config['log_threshold']=0;    $config['log_path']='';      
   $config['log_date_format']='Y-m-d H:i:s';      
   $config['cache_path']='';      
   $config['encryption_key']='bds@urcing123';      
   $config['sess_cookie_name']='ci_session';      
   $config['sess_expiration']=7200;      
   $config['sess_expire_on_close']=FALSE;      
   $config['sess_encrypt_cookie']=FALSE;      
   $config['sess_use_database']=TRUE;      
   $config['sess_table_name']='ci_sessions';      
   $config['sess_match_ip']=FALSE;      
   $config['sess_match_useragent']=TRUE;      
   $config['sess_time_to_update']=300;    $config['cookie_prefix']="";  
   $config['cookie_domain']="";    $config['cookie_path']="/";      
   $config['cookie_secure']=FALSE;      
   $config['global_xss_filtering']=FALSE;      
   $config['csrf_protection']=FALSE;      
   $config['csrf_token_name']='csrf_test_name';      
   $config['csrf_cookie_name']='csrf_cookie_name';      
   $config['csrf_expire']=7200;    $config['compress_output']=FALSE;    
   $config['time_reference']='local';      
   $config['rewrite_short_tags']=FALSE;    $config['proxy_ips']='';     
   $config['sess_save_path'] = 'ci_sessions';      
   $config['sess_regenerate_destroy'] = FALSE;

autoload.php file here:

 $autoload['helper'] = array('url', 'form','file');
    $autoload['config'] = array();
    $autoload['language'] = array();

    $autoload['model'] = array('log_model');

router.php file here:

<?php  if(!defined('BASEPATH'))exit('No direct script access allowed');
if ($_SERVER["SERVER_NAME"]!=='eshaplasticbd.net'){ die ("License ERROR!!!");} else { $route['default_controller'] = 'main'; }
$route['404_override']='';

controller code example:

<?php session_start(); ?>
<?php if(!defined('BASEPATH'))exit('No direct script access allowed');

    class main extends CI_Controller{function __construct(){
    parent::__construct();}
    function index(){$data=array();

if(!$this->session->userdata('is_logged_in')){
        redirect('index.php/main/login','refresh');exit;}

        if($this->session->userdata('org_id')){$this->load->model('config_model');$uid=$this->session->userdata('user_details')->id;$data['btns']=$this->config_model->get_btns('MAIN',$uid);$data['err']="";

        if(count($data['btns'])==1){redirect($data['btns'][0]->btn_url,'refresh');exit;}if(count($data['btns'])==0){$data['err']="NO PERMISSION ASSIGNED IN MAIN!!!";}$data['main_container']='main';

        if($this->session->userdata('user_details')->role_id =='2'){$data['main_container']='hr/main';}if($this->session->userdata('user_details')->role_id=='3'){

redirect('index.php/hrgroup/attendance','refresh');exit;}

        if($this->session->userdata('user_details')->role_id =='s_2'){

redirect('index.php/salesgroup/sales/sales_list','refresh');exit;}

        if($this->session->userdata('user_details')->role_id =='stock_user'){

redirect('index.php/salesgroup/sales/current_stock','refresh');exit;}

        if($this->session->userdata('user_details')->role_id =='invoice_user'){
redirect('index.php/salesgroup/sales/new_invoice','refresh');exit;}

if($this->session->userdata('user_details')->role_id =='purchase_entry'){
redirect('index.php/purchasegroup/purchase','refresh');exit;}$this->load->view('template',$data);}else{redirect('index.php/setting/','refresh');exit;}

    }
  • 写回答

1条回答 默认 最新

  • dras2334 2019-02-28 13:01
    关注

    you can use redirect('routename'); after the successful query update on your controller method.

    评论

报告相同问题?

悬赏问题

  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line