Welcome Guest, Not a member yet? Register   Sign In
Need Refresh in Code Igniter
#1

[eluser]developer_rtpl[/eluser]
I am facing refresh problem in code igniter, for eg:- When I edit a value in a record in CI n then I need to refresh that page to see the changes..Without refresh it shows the old value of that record. I am also facing the same problem when I submit a form or delete any record.Please suggest some solution for that.
#2

[eluser]Thorpe Obazee[/eluser]
Code:
redirect('the_last_uri_segments');
You will probably use this.

For example, you are here: http://localhost/page/edit/1 and then save to the same url, you just redirect to redirect('page/edit/1') or redirect(current_url());

Another sample with the same principle:

Code:
if ($this->form_validation->run('calendar_add') === TRUE)
{
    $this->calendars_model->name = $this->input->post('name');
    $this->calendars_model->description = $this->input->post('description');
    $this->calendars_model->save($id);
    $this->session->set_flashdata('message', 'Calendar Saved');
    redirect(current_url());
}
#3

[eluser]Cro_Crx[/eluser]
bargainph: I think he's talking about losing form data when posting or refreshing, I could be wrong though.
Ranosys: Can you post a snippet of your code so we can have a look at what you're trying to do?
#4

[eluser]Thorpe Obazee[/eluser]
[quote author="Cro_Crx" date="1242641858"]bargainph: I think he's talking about losing form data when posting or refreshing, I could be wrong though.
Ranosys: Can you post a snippet of your code so we can have a look at what you're trying to do?[/quote]

Err... is he?

He says, he sees the changes but only when he refreshes the page, which means he actually is updating the data.
#5

[eluser]Cro_Crx[/eluser]
Sorry my bad, you are correct i just read it again Smile I knew i wrote "I think" for a reason. LOL
#6

[eluser]Thorpe Obazee[/eluser]
That's very normal. I don't usually 'read' a whole post sometimes and read a whole post and still miss something (a lot of things).. Smile




Theme © iAndrew 2016 - Forum software by © MyBB