CodeIgniter Forums
URI not as expected after running controller function - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: URI not as expected after running controller function (/showthread.php?tid=38970)



URI not as expected after running controller function - El Forum - 02-24-2011

[eluser]imcl[/eluser]
Hello friends,

Say my current URI is
Code:
mysite.example.com/profile/user

When I run the upload_avatar controller that's inside profile.php
Code:
//  mysite.example.com/profile/upload_avatar

    function upload_avatar() {
        if ($this->input->post('upload')) {
            $this->profile_model->upload_avatar();
        }
        $this->user();
    }

I expected that function to run and the resulting URI to be
Code:
mysite.example.com/profile/user

because of the last line containing
Code:
$this->user();


But instead, what happens is that the upload_avatar function runs OK, the page is reloaded as expected but the resulting URI now shows
Code:
mysite.example.com/profile/upload_avatar

Any ideas why this is happening?

Thanks.