Codeigniter : flashdata between redirect and loading view
Change in Controller :
$this->session->set_flashdata('flsh_msg', 'You have already signed up using goole. you will be redirected to home page.');
View is just as it is :
<?php echo $this->session->flashdata('flsh_msg'); ?>
Hope this helps you. Thanks!!
Try this.
function signup() { if('user already exists') { $this->session->set_flashdata('flsh_msg', 'You have already signed up using goole. you will be redirected to home page.'); redirect('signup/signup/show_message'); }}
The setting function of flashdata is set_flashdata, not only flashdata.. only flashdata("flsh_msg") will get that string, but set_flashdata set it ;)
//Controller$this->session->set_flashdata('flsh_msg', 'You have already signed up using goole. you will be redirected to home page.');redirect('signup/signup/show_message'); //View<?= $this->session->flashdata('flsh_msg'); ?>