Code Igniter - Get Last URI Segment

I'm tying to get the last URI segment in CI, however I don't know what the number for it will be, as parameters (an integer) will be appended as the user clicks links within the page. These are then used in a controller to pull relevant database records into the page via ajax.

Where is the most efficient position for a code block, which shall only execute, if a loop has reached its end, without having previously been aborted (via break or return)? Provided: "Some Code X" is always the same, only at different Code Segment Positions 1 and 2. I assume: 2 will be executed with the same reliability as 1. Am I wrong I know: 2 is obviously more efficient, as it is only called once after the loop ran $limit times, compared to 1, whose enclosing if-condition is called $limit times, and if once true, the code itself is called. Thus the efficiency difference is if-condition queried $limit times. Hence I conclude: To prefer using Code Segment 2 rather than Code Segment 1, unless my assumption is wrong!

In my projects i often use get params as a temporary way to test things with different values.However it seems like you cannot access get params in code igniter?I am aware I could build a param into my functions and pass the value as a url segment.But i dont want to be doing that every time I wish to test something.So,is there any way to use get values in CI?

I developed a Codeigniter 1.7.2 on wamp and it's almost completed. Now i am trying to host it on IIS 7 (yes IIS! because the control panel that is offered to me only has IIS in it) i am getting errors. This is what i get

I want to convert an application from CakePHP to Code Igniter. Has anyone tried to do this? With my CakePHP application almost all the coding has been done in the controller layer, with the models pretty much exactly as they come out of baking.

I'm getting a lot of errors. And I've tried several suggestion across different sites, deleted the parent function, removed the array, updated my php ini file, no luck. This is the first of 13 errors I'm getting. A PHP Error was encountered Severity: Warning Message: fsockopen() [function.fsockopen]: unable to connect to [URL] (Unable to find the socket transport sslā did you forget to enable it when you configured PHP?) Filename: libraries/Email.php Line Number: 1673

I started using codeigniter for my project. I have user authentication system for my website. I have seen the videos from nettuts for the login information. I am confused why the logout is not working properly. I have the following logout function in my login controller.

function logout() {$this->session->sess_destroy();redirect('main');}

If I click on the logout button I am redirecting the user to the main page. But after redirecting the user to the main page, if click on the back button on the browser I will see the logoff and my name on the top of the page. I need some help on where I am going wrong or is there any important piece of code I am missing in my controller I think I found the solution. I should append the following code into the appropriate controller

A client of mine has a big php website, and wants to add shopping cart functionality. Is it possible to use Code Igniter's shopping cart class, without writing the whole site in the Code Igniter framework? How?

im looking forward flex php developers about their works with CI and flex combination.did you guys feels good and keep things innovativeand im just looking for working samples you have or you came across

i'm trying to redirect to the index method of my main controller like so:

if($provider == '') {redirect('/index/provider1/', 'location');}

but that takes me [URL] when it should go to [URL]. does that make sense can anyone give any advice? this is what my htaccess looks like and i have index_page in config set to blank, although i don't think that the issue is htaccess here it is in case:

I'm writing an app that allows you to filter database results based on Location and Category. If someone was to search for Liverpool under the Golf category the URI would be /index.php/search/Liverpool/Golf. Should someone want to search by Location but not category, they would be sent to /index.php/search/Liverpool However, should someone want to filter only by category they would be unable to use /index.php/search/Golf because that would be caught by the location search.

Is there a best practice way to have /index.php/search/Golf be recognised? Some best practice as to what else to add to the URI to make these two queries distinct? /index.php/search/category/Golf perhaps? Though that is beginning to show characteristics of /index.php?search&category=Golf which is exactly what I'm trying to avoid.

I want to override the Active Record class (some functions of it at least). And I made a file called spj_DB_active_rec.php in a folder named "database" in my "application" folder but it does not work.class name is spj_DB_active_record