Welcome Guest, Not a member yet? Register   Sign In
ci session problem
#2

[eluser]xwero[/eluser]
I think it's safer to work with the segment method of the uri class to get a segment. To do this you have to change the tour method to
Code:
function tour()
{
   if(!$this->uri->segment(3))
   {
       redirect('product/tour/1', 'location');
   }
   else
   {
      $pageNumber = $this->uri->segment(3); //this was for testing - gets it right
            $pg = 'product/tour/'.$pageNumber; // also right
            $this->session->set_userdata('currentPage', $pg);
            echo $this->session->userdata('currentPage'); // also right
            $data['meta_title'] = 'Product :: Tour - page '.$pageNumber; // obviously, the title displays correctly
            $this->load->view('tourpage'.$pageNumber, $data); // it even loads the correct view
   }
}


Messages In This Thread
ci session problem - by El Forum - 11-29-2007, 02:54 AM
ci session problem - by El Forum - 11-29-2007, 03:33 AM
ci session problem - by El Forum - 11-29-2007, 03:56 AM
ci session problem - by El Forum - 11-29-2007, 04:05 AM
ci session problem - by El Forum - 11-29-2007, 04:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB