Welcome Guest, Not a member yet? Register   Sign In
Can't get URI class and jquery Ajax resquest working right.
#3

[eluser]chefnelone[/eluser]
[quote author="noctrum" date="1265068053"]Possible that you're trying to load the URI class after it's already been loaded? IIRC loading it twice empties the uri_segments. Why not just pass the ID into the function?

Code:
function products($product_id) {
  $data['product_id'] = $product_id;
  $data['query'] = $this->get_product_model($product_id);

  $this->load->view('backend/products', $data);    
}
[/quote]

I tried and din't work.

but it was useful to see that it doesn't work even if I take out the line BUT add a segment to the url:

Code:
$data['product_id'] = $this->uri->segment(3);

It seems that it doesn't work if I add a segment to the url like (even if I don't use the uri class):

http://locallhost/ci/site/products/10 //DOESN'T WORK

http://locallhost/ci/site/products // WORKS FINE


Messages In This Thread
Can't get URI class and jquery Ajax resquest working right. - by El Forum - 02-01-2010, 11:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB