Welcome Guest, Not a member yet? Register   Sign In
Catch n check $this->uri->segment(?)
#1

[eluser]Circuitbomb[/eluser]
Ok so maybe my title was a bit confusing.

Using the default controller set in CodeIgniter I'm looking to catch a url similar to

http://mysite.com/index.php/4348q34

using code that looks like:

Code:
if($this->uri->segment(1) === TRUE) {
            
            if(!method_exists(__CLASS__, $this->uri->segment(1)) || !method_exists(__CLASS__, $this->uri->segment(2))) {
                    //echo $this->uri->segment(1);
                    $this->my_lib->my_method($this->my_lib->my_method($this->uri->segment(1)));
                    
            } else {
                
                return;
                
            }
        } else {
            
            return;
        }

in the construct of the default controller.

my_library is being loaded.

Basically, what im trying to do is check to see if the uri segment 1 or 2 exists within the default controller, and if it doesnt to process a method in my library to initialize a redirect to an external site.

any ideas?


Messages In This Thread
Catch n check $this->uri->segment(?) - by El Forum - 11-18-2010, 06:02 PM
Catch n check $this->uri->segment(?) - by El Forum - 11-18-2010, 09:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB