Hello Reader's If you want to make user redirect and show him the error message on next page then by using codeigniter you can do by following functions:-
Let's say if user input wrong username/password then you'll redirect user by following code of redirect:-
redirect('/login/form/', 'refresh');
now in addition you can make the user show the error message on redirected page as follows:-
$this->session->set_flashdata('message', 'This is a message. Showing the error for invalid login');
Now you just have to open the redirected page and put this line on top:-
$this->session->flashdata('message');
And the this message will print for once only.
0 Comment(s)