Articles → PHP CODEIGNITER → flashdata in codeigniter

flashdata in codeigniter






Purpose





Example










$this->load->library("session");
if($this->input->post("username"))
{
    if($this->input->post("username") == "gyansangrah")
    {
        $this->session->mark_as_flash('text');
        $this->session->set_flashdata("text", $this->input->post("username"));
    }
    echo $_SESSION['text'];
}





Output


Picture showing the output of flashdata. The page keeps on setting data in flashdata till the user keep on adding data in textbox.

Click to Enlarge





Picture showing another scenario where page will set flashdata only when word 'Gyansangrah' is entered into the textbox

Click to Enlarge


Posted By  -  Karan Gupta
 
Posted On  -  Monday, August 17, 2020

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250