Welcome Guest, Not a member yet? Register   Sign In
Pagination URI
#1

[eluser]Perkin5[/eluser]
I have set up pagination for my project and it works fine. But when I navigate away from the 'paginated page', I want to be able to return to the same page. I note that the URI has the offset added to it and I have used this:

Code:
$this->session->set_userdata('current',current_url());

to grab that uri. But then if I try to navigate to

Code:
$this->session->userdata('current');

the page can't be found - because of the offset.

I'm sure I'm setting about it the wrong way but I've thought about it quite a bit and I can't work it out. Can anyone advise please?
#2

[eluser]Gerep[/eluser]
What is been returned by the
Code:
userdata('current')
?
#3

[eluser]Perkin5[/eluser]
Code:
userdate('current')
was the entire URI - however, having asked the question, I had another idea.
I used this:

Code:
$this->session->set_userdata('current',$this->uri->segment(3));

Which appears to have successfully grabbed the third segment. So now I can do:

Code:
redirect('shop/item/'.$this->session->userdata('current'));

and that seems to work. Am I doing that the right way?




Theme © iAndrew 2016 - Forum software by © MyBB