Welcome Guest, Not a member yet? Register   Sign In
Flashdata not clearing on refresh/redirect
#4

(This post was last modified: 02-12-2021, 10:33 AM by demyr.)

Well,
in your controller:

1- get the data from your view (You can check the link I am leaving for step 2)
2 check if they pass your rules or not (Follow this link)
3- if yes, pass them to model.
4- if not, turn back an error (no need for flashdata).

- - - -

3- If you pass your data to model and to database successfully then you can call your flashdata, like:

PHP Code:
$data = [
  'name' => $name,
  'surname' => $surname,

etc..

];

$result $this->MyModel->lets_do_sth($data);
if(
$result){
$this->session->set_flashdata('success_message''You did it.');

        redirect('lets_go_to_login');



By the way, why don't you go with CI 4?
Reply


Messages In This Thread
RE: Flashdata not clearing on refresh/redirect - by demyr - 02-12-2021, 10:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB