I am making a form in CI and submit the form. After submitting, the page redirects to another page but before redirect I am use set_flashdata
but without using set_flashdata
my form submits successfully and page redirects to another page. But when using set_flashdata
then it doesn't redirect and loads a blank page and then the site stops working and all another pages of my site load a blank page.
{
$this->load->helper('file');
$data = $this->input->post('data');
if ( ! write_file('./application/modules/widgets/'.$alias.'.php', $data))
{
//$this->session->set_flashdata('msg', '<div class="alert alert-error">'.lang_key('unable_to_write_widget').'</div>');
}
else
{
//$this->session->set_flashdata('msg', '<div class="alert alert-success">'.lang_key('widget_data_updated').'</div>');
}
}
redirect(site_url('admin/widgets/edit/'.$alias));