Codeigniter Flash数据未被清除

时间:2015-02-02 05:49:43

标签: codeigniter

public function student_email()
{
    $opt=$this->uri->segment(3);
    $class=$this->input->post('class');
    $edu_level=$this->input->post('edu_level');
    $data=$this->newsletter_model->get_StudentData($opt,$class,$edu_level);
    $subject=$this->input->post('txtSubjectRequired');
    $message=$this->input->post('txtMessageRequired');
    $message=nl2br($message);
    $note="student";//Variable for Identifying Students alone
    //Test Email
    $email=$this->input->post('txtEmail');
    if(trim($email)!=''){
        $note="test";
        $name="User";
        $data=$email;
        $this->sendMail($data,$subject,$message,$note,$name);
    }
    else {
        //$this->sendMail($data,$subject,$message,$note,$text,$name='');
    }
    if($this->session->userdata('mail_status')=="success"){
        $this->session->set_flashdata('success', 'Mail sent Successfully.');
    }
    else{
        $this->session->set_flashdata('success', 'OOPS.! Mail Sending failed..!.');
    }
    $this->session->unset_userdata('mail_status');
    redirect('/newsletter/student/'.$opt , 'refresh');
    /**Note:
     * Filter by field of study and Last topic need to be coded..
     */
}
  • 点击后退按钮时,flash data未被清除。
  • 这是一个缓存问题..?任何其他
  • 任何解决方案而不是禁用缓存? 请帮我解决..

1 个答案:

答案 0 :(得分:0)

<?php
header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
?>
  • 我找到了这段代码

    它解决了这个问题..