Welcome Guest, Not a member yet? Register   Sign In
Flashdata and userdata in one function
#1

[eluser]CodeIgniterNoob[/eluser]
I have a function that needs to keep userdata and then echo a success statement on the next page using Flashdata. Its a page that edits posts, but I cant have them both because I get the "headers already sent" error. Can anyone help?

Code:
function edit($id=NULL)
    {
        if ($this->session->userdata('logged_in'))
        {
            echo 'Logged as: '.$this->session->userdata('username');
        }
        else
        {
            redirect('welcome/login','refresh');
        }
        
        if ($this->input->post('name'))
        {
            $this->MPages->updatePage();
            $this->session->set_flashdata('message','Page Updated!');
            redirect('admin/pages/index','refresh');
        }


Messages In This Thread
Flashdata and userdata in one function - by El Forum - 10-29-2008, 01:24 PM
Flashdata and userdata in one function - by El Forum - 10-29-2008, 01:37 PM
Flashdata and userdata in one function - by El Forum - 10-29-2008, 01:49 PM
Flashdata and userdata in one function - by El Forum - 10-29-2008, 02:01 PM
Flashdata and userdata in one function - by El Forum - 10-29-2008, 02:23 PM
Flashdata and userdata in one function - by El Forum - 10-29-2008, 03:32 PM
Flashdata and userdata in one function - by El Forum - 10-29-2008, 08:30 PM
Flashdata and userdata in one function - by El Forum - 10-30-2008, 10:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB