Welcome Guest, Not a member yet? Register   Sign In
Problem using uri->segment - should be easy....[SOLVED]
#6

[eluser]tinawina[/eluser]
I just recoded the controller to use $_SERVER['REQUEST_URI'] rather than $this->uri->segment and it works. But, because I LOVE CI, I'm going to undo what I did and swap out $this->uri for $this->article as per tonanbarbarian's suggestion. I totally see what you are saying! And I knew it wasn't CI letting me down!

ucantblamem -- I've read this about php5 and problems using __construct. I haven't had a problem, but will stick that tip in my programming toolbox as a test when all else fails.

Thanks for all the help! I have pasted my $_SERVER['REQUEST_URI'] controller below just in case someone wants to use it for.....something. ~tinawina

Code:
function index()
    {
        $uri = $_SERVER['REQUEST_URI'];    

        $uri = eregi_replace('/ratings/', '', $uri);
        $explode_uri = explode('/', $uri);
        $rate_uri = $explode_uri[0];
        $rating = $explode_uri[1];

        $rated_by_user = $this->ratings_data->checkUser($rate_uri, $this->screen_name);
        if ($rated_by_user === true)
        {
            redirect ('article/' . $rate_uri);
        }
        else
        {
            $update = $this->ratings_data->updateListing($rate_uri, $rating, $this->screen_name);
            redirect ('article/' . $rate_uri);
        }
    }


Messages In This Thread
Problem using uri->segment - should be easy....[SOLVED] - by El Forum - 12-15-2007, 12:51 PM
Problem using uri->segment - should be easy....[SOLVED] - by El Forum - 12-15-2007, 02:19 PM
Problem using uri->segment - should be easy....[SOLVED] - by El Forum - 12-15-2007, 04:13 PM
Problem using uri->segment - should be easy....[SOLVED] - by El Forum - 12-15-2007, 04:22 PM
Problem using uri->segment - should be easy....[SOLVED] - by El Forum - 12-15-2007, 04:24 PM
Problem using uri->segment - should be easy....[SOLVED] - by El Forum - 12-15-2007, 04:42 PM
Problem using uri->segment - should be easy....[SOLVED] - by El Forum - 12-15-2007, 05:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB